Question

Should an HTTP server expect to receive requests with different Host fields on the same TCP connection? Though it is contrary to intuition, RFC 2616 seems not explicitly forbiding a client to multiplex requests to different hosts on the same connection if it sees fit.

Is there any normative rule in any relevant document which forbids this? If there isn’t, is there any practical consideration which effectively prevents this, and therefore allows the server not to check the host on each request?

Was it helpful?

Solution

Quoting William Chan of Chromium:

Beyond SPDY, this doesn't happen, except for proxy servers.

We've actually discussed reusing TCP connections to different hosts if the ip addresses overlap, but were considered about security and broken HTTP server implementations (let's say you have a reverse proxy HTTP server that has different application server backends, perhaps with different owners...a broken reverse proxy may just assume all connection reuse will be to the same application server backend, which would be bad).

So it is quite possible, altough Chromium for one does not do so.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top