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
  • 11,234
  • 8
  • 45
  • 51
Adam Lee
  • 24,710
  • 51
  • 156
  • 236

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,876
  • 8
  • 41
  • 75
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
  • 11,234
  • 8
  • 45
  • 51