0

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?

Ye Lin Aung
  • 10,829
  • 6
  • 44
  • 49
Adam Lee
  • 23,314
  • 47
  • 144
  • 221

2 Answers2

7

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.

Kylar
  • 8,466
  • 7
  • 42
  • 74
0

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.

Community
  • 1
  • 1
Ye Lin Aung
  • 10,829
  • 6
  • 44
  • 49