How Proxy server works with tcp/http connections?

12,914
  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.

Share:
12,914
Vivek Mohan
Author by

Vivek Mohan

Expert in software development with experience in various technical platforms. Skilled in iOS development, Web applications, Web services, Software design architecture and design patterns. Big fan of clean architecture, code quality and code documentation.

Updated on June 19, 2022

Comments

  • Vivek Mohan
    Vivek Mohan almost 2 years

    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.

  • Vivek Mohan
    Vivek Mohan about 12 years
    Thanks for ur response. Are you stating that proxy server is acting like original server infront of client? Or if there is a way for a client application to detect if it is talking to a proxy / real server?
  • cyber-guard
    cyber-guard about 12 years
    With regular HTTP proxy it very much depends, some send additional HTTP headers indicating that it is proxy server request (X-Forwarded-For). There also are other techniques to find whether a user is behind proxy (flash, ajax, combination of the two...), but if the proxy server is set up correctly it can be quite difficult to detect whether the connection is from proxy or not. As for websockets, I don't believe there is such specification, so there may be ways around it, but by default it is not possible to determine whether the packets are from the user or not...
  • Vivek Mohan
    Vivek Mohan about 12 years
    From the Kaazing's site [websocket.org/aboutwebsocket.html, I think that websockets never care(once it is implemented) about the proxy server by providing HTTP tunneling. But I still wonder if this happens only for ws or wss(secure)?
  • cyber-guard
    cyber-guard about 12 years
    Ok so apparently it depends on the behavior of the proxy server, because in case of transparent proxy the client will not use HTTP CONNECT to set up the persistent tunnel. Most of your questions are answered in the first article I supplied, I don't want to paraphrase because quite frankly right now I find it a little confusing myself...