Originally, I used Socket to write a simple implementation of HTTP. The result is a lot of search, and I have written it yet, I will no longer be repeated. I opened this post, record the problem I have encountered in the HTTP process:
1.
Q: Why do I receive an HTTP header, other data is garbled?
A: Not garbled, these data is compressed or encrypted, you can determine what is the reason for the HTTP header, according to the following field [accept-encoding]
2. HTTP redirection
Q: How to convert http://www.xx.com/down.asp?id=32 into http://www.xx.com/xx.zip
A: For files with redirection, Wininet will return to you a 301 or 302 error, you will pick the location from the response head, and send a request.
3. HTTP tunnel
Q: What technology is the technology of the HTTP tunnel, how to achieve, is there a code code?
A: HTTP tunnel (HTTP proxy Socket)
http://dev.9cbs.net/develop/Article/18/18114.shtm