【问题标题】:How to access a website localhost(https) from mobile browser?如何从移动浏览器访问网站 localhost(https)?
【发布时间】: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

我试过了。

  1. 运行 https 网络服务器(SimpleHTTPServer)https://gist.github.com/dergachev/7028596
  2. https://localhost:$port 从手机浏览器访问网站 localhost(localhost 和 mobile 是同一个网络)。我尝试了其他ip,但这里相同(localhost:$port,127.0.0.1:$port,192.168.25.38:$port)
  3. 显示消息: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

标签: mobile https localhost


【解决方案1】:

我已经通过其他网络服务器解决了这个问题。但是我在 simple-http-server 中没有发现问题。

我尝试并成功了https://www.npmjs.com/package/http-server

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-16
    • 2019-04-07
    • 1970-01-01
    • 2011-02-20
    • 2017-09-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多