Work, we will inevitably need to send a message through the TCP/IP protocol to directly request Web content (such as crawler tools), a classmate asked how to request the Web page through HTTP proxy, in fact, we just need to change the message slightly, sent to the proxy server can be achieved.
Foundation of the friend can search under: HTTP message, HTTP proxy principle; I'm just going to write an experimental message here.
The following is a basic HTTP request message that sends the message to tl.godok.cn: 80, which implements the Web request
get/ip.php http/1.1host:tl.godok.cnconnection:keep-alive
Here is a message with the HTTP Proxy request page
GET http://tl.godok.cn/ip.php http/1.1host:tl.godok.cnproxy-connection:keep-alive
The message requested by the agent is similar to the one directly requested, with only 3 points to be noted:
1. Message sent to the proxy server, not to the final request address of the server
2. The URI path of the first line of the message is to write the complete
3. Connection converted to Proxy-connection
"HTTP proxy message" through the contract to implement proxy request Web page content