【问题标题】:cannot access simple http server无法访问简单的 http 服务器
【发布时间】:2016-12-21 15:45:48
【问题描述】:

我使用

创建了一个简单的简单 http 服务器

python -m SimpleHTTPServer

我可以通过我的笔记本电脑或手机访问它,但是当通过另一个位置访问它时,它显示网页不可用,或者当我尝试通过浏览器的 VPN 访问它时,它也会出现错误:无法检索请求的 url .. 似乎是什么问题? 我在这里粘贴 wget 的输出

   wget 192.168.43.171:8000
   --2016-08-15 17:40:06--  http://192.168.43.171:8000/
   Connecting to 192.168.43.171:8000... connected.
   HTTP request sent, awaiting response... 200 OK
   Length: 242 [text/html]
   Saving to: ‘index.html’

   index.html          100%[====================>]     242  --.-KB/s   in       0s     

   2016-08-15 17:40:06 (28.8 MB/s) - ‘index.html’ saved [242/242]

【问题讨论】:

标签: python simplehttpserver


【解决方案1】:

以 192.168 开头的 IPv4 地址是本地网络块的一部分。 您无法在本地网络之外访问它们。

另请参阅:http://xkcd.com/742

【讨论】:

  • 可爱,但在你的答案末尾有一个指向xkcd.com/742 的简单链接可能比嵌入这些东西要好......
猜你喜欢
  • 2015-12-07
  • 2014-03-24
  • 1970-01-01
  • 2015-06-13
  • 2019-07-29
  • 1970-01-01
  • 2018-10-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多