Ngrok无法与正常运行的本地localhost建立连接问题求助
大家好,我现在碰到个棘手的问题,想请各位大佬帮忙排查下:
- 我本地正常运行着一个基于.NET 8的WebAPI服务,用的是Kestrel服务器,监听在
localhost:8080端口,直接访问本地地址是完全正常的 - 为了把这个本地服务暴露到公网,我用Docker启动了ngrok容器,执行的命令是:
docker run --net=host -it -e NGROK_AUTHTOKEN=[MyAuthToken] ngrok/ngrok:latest http 8080 - 从ngrok的日志输出来看,容器本身是启动成功的,日志内容如下:
ngrok (Ctrl+C to quit)
Help shape K8s Bindings https://ngrok.com/new-features-update?ref=k8s
Session Status online
Account nativ bashari (Plan: Free)
Update update available (version 3.15.1, Ctrl-U to update)
Version 3.15.0
Region Europe (eu)
Latency 62ms
Web Interface http://0.0.0.0:4040
Forwarding F...
可是现在ngrok就是没办法和我本地的localhost服务建立有效连接,访问ngrok生成的公网转发地址时,根本无法正常访问到我的WebAPI。有没有朋友能帮我分析下可能的问题点,或者该怎么排查?
备注:内容来源于stack exchange,提问作者נתיב בשארי

