【问题标题】:Telnet HTTP free server restrictionTelnet HTTP 免费服务器限制
【发布时间】:2013-11-22 19:23:42
【问题描述】:

我想使用 telnet 获取整个页面:

远程登录 o test.bugs3.com 80 GET / HTTP/1.0

实际上,除了这个,我几乎可以访问任何网站。其他免费服务器也会出现同样的问题。我只想知道究竟是什么导致了这样的限制。 请求如下:

Connected.
HTTP/1.1 200 OK
Server:
Date: Mon, 11 Nov 2013 04:11:47 GMT
Content-Type: text/html
Content-Length: 328
Last-Modified: Thu, 16 May 2013 12:17:53 GMT
Connection: close
Accept-Ranges: bytes

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>Account unavailable</title>
</head><body>

<h1>Account unavailable</h1>

<p>Maybe account have been moved, deleted, suspended or not activated yet.

<p>The requested resource could not be found but may be available again in
the future.

<hr>
</body></html>

【问题讨论】:

    标签: http request telnet


    【解决方案1】:

    这是因为您没有发送 Host: test.bugs3.com\r\n 标头。 RFC 2616 #14.23:“客户端必须在所有 HTTP/1.1 请求消息中包含 Host 标头字段。”

    【讨论】:

    • 所以一个网站需要带有 Host 和 Connection 标头的 HTTP 1.1 版,而另一个网站需要没有它们的 1.0 版。我说的对吗?
    • HTTP 1.1 需要它。 HTTP 1.0 似乎没有。如果你真的遇到过 HTTP 1.0 服务器会解释它。
    猜你喜欢
    • 2011-06-11
    • 2020-11-14
    • 1970-01-01
    • 2016-05-07
    • 1970-01-01
    • 2013-11-10
    • 2015-09-15
    • 1970-01-01
    • 2017-01-26
    相关资源
    最近更新 更多