Suppose there is no proxy between the http client and the http server
there is an IP add开发者_JS百科ress in the TCP header, and the value of the http host field can also be an IP address, can anyone think of a situation where these two IP addresses are different?
Yes, it's possible. Strictly speaking, the Host: header is just another header. If you're using something like curl, you can specify any host header you want. The header USUALLY contains the host that was resolved in the stack. If you're talking directly to an IP, there may not be any host header at all.
Now, having said that, it's unlikely that the two would be different if you're assured that there is nothing between the client and server.
精彩评论