我刚刚在本地计算机上安装了ngrok,
ngrok http 80
照常。
但是,当我尝试访问端口80时
localhost:80
我收到此错误消息
The connection to http://*******.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.
我真的不确定为什么会发生这种情况,并在stackoverflow上浏览了一下,但是并不太理解我读到的答案。希望从这里重新诊断并建立理解。
操作系统是Mac OS。
最佳答案
ngrok使我们能够通过本地服务器与http://xxx.ngrok.io连接。是的,您要做的只是运行诸如Apache,nginx之类的服务器。允许使用您的语言内置本地服务器。
sudo apachectl start
ngrok http 80
如果您喜欢PHP,则可以按照以下说明进行操作。
php -S localhost:8080
ngrok http 8080
祝你好运:D
关于tunnel - Ngrok:如何打开端口80,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35176844/