如何修复 ngrok 无效 HTTP 响应错误

Pra*_*pra 24 ngrok

我正在使用 zphisher。当我创建到 ngrok 的链接时,会生成该链接,但在打开它时,它说ngrok gateway error The server returned an invalid or incomplete HTTP response.我从 ngrok 错误文档中得知这是错误 3004。他们告诉了错误代码和消息,但没有可能的方法来修复错误。有人能帮助我吗。我想我哥哥在网上上课时会观看 YouTube,我想效仿这一点。没有网络钓鱼。请。我完全没有从任何地方得到帮助。我的一位朋友告诉我,我需要一个 ngrok 帐户。试过了,不行。

小智 25

一段时间后,我做了两件事解决了这个问题:

  1. 确保我的本地站点是 http (不是 https)
  2. 运行命令ngrok http -host-header=rewrite localhost:PORT

  • 正如其他人所说,您可以使用完整地址而不仅仅是端口来托管本地 https 站点:`ngrok http https://localhost:8433` (3认同)

csh*_*rpQ 19

如果您的网站使用下面的 https://localhost:port 确实适合我

ngrok http https://localhost:port --host-header=rewrite
Run Code Online (Sandbox Code Playgroud)

  • 尝试了各种语法,但附加 `--host-header=rewrite` 是解决方案。 (3认同)

Mik*_*ubs 14

对我来说,当我收到 3004 错误消息并尝试访问 HTTPS 时,此命令有效https://localhost:3000

./ngrok http https://localhost:3000
Run Code Online (Sandbox Code Playgroud)

  • 同样,头脑需要 `ngrok http https://localhost:5001 -host-header="localhost:5001"` (而不是 [microsoft docs](https://learn.microsoft.com/en-us/azure/ azure-functions/functions-debug-event-grid-trigger-local)表明仅需要“ngrok http -host-header=localhost 5001”) (4认同)

小智 5

我在此链接中找到了答案,它解决了我的问题。

根据这个你可以使用这个命令来代替:

ngrok http https://localhost:[port]
Run Code Online (Sandbox Code Playgroud)