In the http protocol, I saw sometimes we have a HOST header, like
Host: www.google.com:3333
what's the usage for this header? Why do we need this header?
In the http protocol, I saw sometimes we have a HOST header, like
Host: www.google.com:3333
what's the usage for this header? Why do we need this header?
When an http request hits a server, it only hits an IP/Port combination. This header shows which host was actually requested.
Many machines serve multiple hosts from the same IP. Without this header, they wouldn't know which host was requested.
Answer from here.
See section 14.23 of the HTTP spec which specifies that the port should be included if its not the default port of 80.