开发者

A question about the consistency of the TCP header and HTTP header

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜