4
2
Before getting to the real question, let me explain how my project works: for sake of simplicity, my proxy is on my laptop, where the client (my browser) also is; the remote server will be, for example, YouTube.
The client is connected to a specific port of the proxy thanks to SwitchOmega plugin: the client wants to connect to www.youtube.com and the proxy gets the following request:
CONNECT www.youtube.com:443 HTTP/1.1
Host: www.youtube.com:443
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36
I was told that when a proxy gets a CONNECT
request, it should open a TCP connection to IP:Port, return a 200 OK
message to client and send data until one side of the connection is closed.
With another plugin that tracks HTTP requests, HTTP Trace, I see a different request on my browser:
GET https://www.youtube.com/
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
and other data...
So, why my proxy receives CONNECT www.youtube.com:443 HTTP/1.1
while HTTP Trace shows GET https://www.youtube.com/
? Do they mean the same thing?
1So...
CONNECT
is used to establish a tunnel connection, andGET https
is sent by the client asking for resources to the remote server after the successfull connection created byCONNECT
request? – elmazzun – 2016-03-23T17:53:27.5831
CONNECT
is used to establish a TCP/IP tunnel, but not necessarily an SSL connection, andGET
simply retrieves resources. – elmazzun – 2016-03-23T19:06:48.2301So
GET https
means a previousCONNECT
to port 443? – elmazzun – 2016-03-23T22:44:44.243I parse
CONNECT www.youtube.com:443 HTTP/1.1
and get the port number after:
, that's why I said 443. – elmazzun – 2016-03-24T09:00:43.260