If a proxy receives the tcp packet, then the destination ip address and port are that of the proxy. In that case, I imagine the only way a proxy can still resolve the intended destination is either through routing the source ip address/port or through the host field in the http header. Is this correct?

In both Fiddler and Charles http proxies, I noticed that the tool accepts both http and https connections through a single port that you can specify. What do these tools do to tell the difference between the two types of connections?

1 Answer
1

HTTP requests consist of a "GET", "PUT", or similar verb. HTTPS requests consist of a "CONNECT" request, since the browser is asking the proxy to make a connection. The proxy determines the address to connect to because it's the parameter to the CONNECT request.

See the Wikipedia entries on HTTP tunnel. Also see this link which shows some actual HTTP and HTTPS proxy traffic.