2

Suppose there is no proxy between the http client and the http server

there is an IP address 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?

PeopleMoutainPeopleSea
  • 1,492
  • 1
  • 15
  • 24
  • 2
    Generally these will match, but it's certainly possible for the client to send a malformed request with an invalid Host header to a different IP address than was specified in the Host header. Why specifically do you ask? – EricLaw Mar 09 '11 at 09:37

1 Answers1

2

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.

Kylar
  • 8,876
  • 8
  • 41
  • 75