我正在尝试运行ngrok并在google colab上建立连接。代码运行得很好,但我得到以下错误:
The connection to http://7f319cc47f9f.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:80.
Make sure that a web service is running on localhost:80 and that it is a valid address.
The error encountered was: dial tcp 127.0.0.1:80: connect: connection refused
现在我是ngrok的新手,对服务器的工作原理知之甚少。因此,如果你们中的任何人对此有解决方案,请给我一个逐步的解决方案。此外,我听说运行服务器可以解决这个问题,但我还没有弄清楚是如何解决的。我使用端口8051
。
发布于 2020-12-06 09:07:06
您正在通过隧道连接到端口80,但该端口上没有运行任何内容。正如您提到的端口8051,我认为这就是您想要进行隧道传输的地方。看起来您使用的是pyngrok
,所以according to the docs您可以指定一个端口,而不是默认的80,如下所示:
ngrok.connect(8051)
https://stackoverflow.com/questions/65162978
复制相似问题