Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Proxy server works with tcp/http connections?

Since I am a beginner in the world of internet/networking, I always mess up with these kinds of doubts in my head while programming ;) .. My doubts are,

  1. While working behind a proxy, how do my requests and responses work? Does it mean that my request headers and data will first reach to Proxy server-> then proxy server sends it(same headers and data) to corresponding server. And server responses to it with a response header and body to the proxy server->then proxy server sends it to my computer. Right?

  2. While using websockets we are upgrading our HTTP connection to TCP. At this time what is happening at the Proxy server? Does the proxyserver also upgrades its connection to plain TCP?

  3. After opening such TCP connections, does the proxy server able to track/log those socket messsages?

  4. And most importantly, Is the proxy server transparent or acting like an original server infront of a client?

Thanks for any answers or helpful links in advance.

like image 290
Vivek Mohan Avatar asked Nov 05 '22 01:11

Vivek Mohan


1 Answers

  1. Right.

  2. There is no such thing as 'upgrading HTTP to TCP'. An HTTP connection already is a TCP connection. The question is therefore meaningless.

  3. It is able to trace the connection, and it can see all the data being exchanged in both directions.

  4. I'm not sure what this means. After processing the CONNECT command, a proxy just copies bytes in both directions. Possibly this is 'transparent' in the terms of your question.

like image 82
user207421 Avatar answered Nov 15 '22 08:11

user207421