Proxy server

Build simple proxy server in Python

for understanding how proxy server works.

There are reverse proxy and forward proxy. Reverse proxy handle the request coming to your server, manipulate it and then send to your server. Forward proxy, handle the request you sent from your side to the target site, manipulate it. In short, proxy work as the middle man.

In this post we will implement forward proxy.

The code:

Now we’re done with building a proxy server. Let’s call some requests from the client.

Forward proxy

And calling to localhost:33333 will actually forward request to, and we got the response data from the ncbi site.


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store