gpt4 book ai didi

asp.net - 带有 Visual Studio 2017 和 IIS Express 的 ngrok 无法连接

转载 作者:行者123 更新时间:2023-12-02 06:13:21 38 4
gpt4 key购买 nike

因此,根据此处的 twilio 文档,我正在尝试将我的开发机器设置为能够响应某些 webhooks:

https://www.twilio.com/docs/usage/tutorials/how-use-ngrok-windows-and-visual-studio-test-webhooks

我已经安装了 ngrok,并启动并运行了隧道,指向在 Visual Studio 中指定的端口。在本例中,为 44336。
enter image description here
enter image description here

但是,如果我去访问外部 URL,我的加载时间很长,最终会出现 502 错误。访问 localhost 按预期工作正常。

因此,我尝试将 ngrok 设置为指向 8080,并且我取得了一些进展,但仍然没有运气在浏览器中出现以下错误消息。

enter image description here

通过第一次隧道尝试,我可以看到 GET/请求出现在 ngrok 客户端中,但没有错误。在第二次尝试中,我可以看到 502 错误:

enter image description here

所以我有两个问题:如何诊断问题的根源?以及如何设置 IIS 以接受来自 ngrok 的连接?

最佳答案

这已在最新版本的 ngrok(此时为 2.3.23)中得到解决。

可以在此处引用相关的已关闭问题:https://github.com/inconshreveable/ngrok/issues/448

您现在可以运行:

ngrok http https://localhost:<port> -host-header="localhost:<port>"

对于您的示例:
ngrok http https://localhost:44336 -host-header="localhost:44336"

关于asp.net - 带有 Visual Studio 2017 和 IIS Express 的 ngrok 无法连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52192673/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com