Tuesday 23 April 2019

networking - How exactly does a proxy work?


If I want to connect to say, IP 100.100.100.100, Port 80, my computer will send a tcp packet with this adress into the wire.


Now If I use a proxy server say, 200.200.200.200 Port 8080 (such kind of proxy that you can set up in internet explorer) how is this process changed?


When I still want to connect to the same IP, will the IP header will include the destination IP or the proxy IP or both?


I already googled, there are hundreds of pages that tell you how to set up a proxy but none explains how it works under the hood.



Answer



The HTTP request is sent from Client to port 8080 of the Proxy Server. The Proxy Server then originates a new HTTP request to the destination site. The proxy, depending on the configuration, will often add a "X-Forwarded-For" header to the HTTP request. The log files on the destination web site will show the proxy's IP address, but may or may not be configured to log the "X-Forwarded-For" address.


That's the typical configuration, but proxy software will allow you all kinds of customization.


EDIT: I should note that when I originally read your question, I got the idea you were asking about an HTTP Proxy specifically, such as squid or nginx. There are many different types of proxies available. In Internet Explorer, you'll most likely be using an HTTP proxy, but there are many other types as well.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...