【发布时间】:2019-02-14 19:59:03
【问题描述】:
我的环境
PC:Macbook pro、Mac os High Sierra 10.13.3
手机:iPhone6s、iOS 11.4.1
私有IP:192.168.25.38
我试过了。
- 运行 https 网络服务器(SimpleHTTPServer)https://gist.github.com/dergachev/7028596
- https://localhost:$port 从手机浏览器访问网站 localhost(localhost 和 mobile 是同一个网络)。我尝试了其他ip,但这里相同(localhost:$port,127.0.0.1:$port,192.168.25.38:$port)
-
显示消息:safari 无法打开页面,因为 safari 无法与服务器建立安全连接
但是,电脑浏览器可以访问https://localhost:$port
我也使用了 http 网络服务器(无 ssl)。可以通过手机浏览器访问网站localhost。(localhost:$port, 127.0.0.1:$port, 192.168.25.38:$port)
结果
- Http 服务器可以从移动网络浏览器访问。但是 https 服务器无法从移动网络浏览器访问。我想通过移动网络浏览器访问 http 服务器。
【问题讨论】:
-
你解决了吗?
-
是的。我已经通过其他网络服务器解决了这个问题。但是我在 simple-http-server 中没有发现问题。我用这个。 npmjs.com/package/http-server