HTTP GET请求显示Google 404页面

时间:2020-04-01 20:30:29

标签: http

因此,我一直在尝试通过telnet连接到myexternalip.com以获得我的IP:

$ telnet myexternalip.com 80
Trying 216.239.34.21...
Connected to myexternalip.com.
Escape character is '^]'.
GET /raw HTTP/1.1<Return>
<Return>

HTTP/1.1 404 Not Found
(and here is Google's 404 html page source)

然后,我在网上查找了该问题,发现我必须添加另一行:

GET /raw HTTP/1.1
Host: myexternalip.com

HTTP/1.1 200 OK
(success, my ip from 'myexternalip.com/raw')

我不明白的是:

  • 这是Host: ...行,是HTTP命令吗?
  • 在没有Host:的情况下为什么会向我显示Google 404页面?
  • 当我在浏览器中输入myexternalip.com IP地址216.239.34.21(我想是从DNS解析)时,它也给了我Google 404。 为什么?

0 个答案:

没有答案