我需要在使用kestrel托管的asp.net core 2 api中调试webhook。 它只能在https:https://localhost:44338中运行(可访问,工作正常)
我认为ngrok可以快速使用,但我总是被重定向到错误502.
我已经尝试过在其他帖子中找到的那些结论:
ngrok http -region=eu -bind-tls=true -host-header=rewrite localhost:44338
ngrok http 44338 -region=eu -host-header="localhost:44338"
ngrok.exe http -region=eu -host-header=rewrite localhost:44338
ngrok tls -region=eu -hostname=localhost 44338
已添加到
netsh http add urlacl url=https://xxx.ngrok.io:44338/ user=everyone
但没有变化,任何想法?
编辑:
ngrok http -region=eu -host-header=rewrite localhost:8592
netsh http add urlacl url=http://xxxxxxxx.eu.ngrok.io:8592/ user=everyone
答案 0 :(得分:0)
我刚刚陷入同样的困境,我有一个使用Kestrel服务器的.net core 2.2项目,该项目在端口5001(开箱即用)上提供https。
为了使ngrok正常工作(版本2.3.29-在撰写本文时作为新PC下载,我以前从未使用过它)。
仅运行ngrok http https://localhost:5001
就返回了我现在可以用来调试webhook的网址。
希望这会有所帮助。