Ngrok在同一域中配置多个端口 [英] Ngrok configure multiple port in same domain
问题描述
是否可以在同一域的 ngrok 中打开多个端口?
Is it possible to open multiples ports in ngrok in same domain?
类似的东西:
转发 http://example.ngrok.com:50001 -> 127.0.0.1:50001
Fowarding http://example.ngrok.com:50001 -> 127.0.0.1:50001
聚焦 http://example.ngrok.com:50002 -> 127.0.0.1:50002
Fowarding http://example.ngrok.com:50002 -> 127.0.0.1:50002
我在Windows中工作,它将对使用 IIS Express
I´m working in windows and it'll be useful for debuging with IIS Express
推荐答案
是的,可以使用 hostname 内的多个同时隧道 !
Yes, it is possible using multiple simultaneous tunnels, within the same hostname
!
您需要做的就是在配置文件中声明它们,如下所示:
All you need to do, is to declare them on your configuration file, like this:
authtoken: 4nq9771bPxe8ctg7LKr_2ClH7Y15Zqe4bWLWF9p
tunnels:
first-app:
addr: 50001
proto: http
hostname: example.ngrok.com
host_header: first-app.example.ngrok.com
second-app:
addr: 50002
proto: http
hostname: example.ngrok.com
host_header: second-app.example.ngrok.com
并使用以下命令运行它们:
And run them with:
ngrok start --all
查看文档中的选项,例如 hostname
, subdomain
, authtoken
和 host_header
.希望对您有帮助!
Look on the documentation for options, like hostname
, subdomain
, authtoken
and host_header
. Hope this help you !
PS 对于免费计划,请删除自定义主机和标题部分像这样,这将是不同的域供参考.
P.S For Free plan remove custom host and header part like this it will be different domains FYI.
authtoken: 6yMXA63qefMZqCWSCHaaYq_5LufcciP1rG4LCZETjC6V
tunnels:
first:
addr: 3002
proto: http
second:
addr: 8080
proto: http
注释:
-
要找到您的默认配置文件,请阅读
https://ngrok.com/docs#default-config-location
.
所有计划均发布身份验证令牌.您可以在Web仪表板中找到您的文件: https://dashboard.ngrok.com/get-started
All plans issues an auth token. You can find yours in the web dashboard: https://dashboard.ngrok.com/get-started
这篇关于Ngrok在同一域中配置多个端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!