内网穿透工具使用
原创
©著作权归作者所有:来自51CTO博客作者wx57ac012361806的原创作品,请联系作者获取转载授权,否则将追究法律责任
相关博客1
相关论坛1
注意80端口占用问题,如果被占用是无法启动的
两个链接,一个不行,另一个应该就可以了
./bin/ngrokd -tlsKey=server.key -tlsCrt=server.crt -domain="ngrok.ykmimi.com" -httpAddr=":80" -httpsAddr=":443"
新版使用
还是基于上面两个链接做服务器端布设.
在服务器LINUX端持续运行ngrok服务
#!/bin/bash
tbp=/usr/local/ngrok/
cmd=$1
if [[ -z $cmd ]];then
echo "err!usage{sh $0 1|0 to start or shutdown the ngrok.}"
elif [[ $cmd -eq 1 ]];then
nohup $tbp/bin/ngrokd -tlsKey=$tbp/server.key -tlsCrt=$tbp/server.crt -domain="ykmimi.com" -httpAddr=":80" -httpsAddr=":443" > listen.log &
# $tbp/bin/ngrokd -domain="ykmimi.com" -httpAddr=":80" -httpsAddr=":443"
elif [[ $cmd -eq 0 ]];then
echo "todo shutdown"
else
echo "err!just 1 or 0 behind $0,like(sh $0 1)"
fi
前面的#!/bin/bash注解是必须的
如果不需要持久运行则去掉 nohub以及后面的 > listen.log &
配置多个端口:
参考1 https://free-e.net/112
参考2 http://www.siguoya.name/pc/home/article/257
客户端启动并链接
可以使用的 ngrok.cfg :
server_addr: "www.ykmimi.com:4443"
trust_host_root_certs: false
tunnels:
client:
subdomain: "www"
proto:
http: 80
client1:
subdomain: "ngrok"
proto:
http: 8080
client2:
subdomain: "test"
proto:
http: 80
test90:
subdomain: "test90"
proto:
http: 90
test91:
subdomain: "test91"
proto:
http: 91
test92:
subdomain: "test92"
proto:
http: 92
test93:
subdomain: "test93"
proto:
http: 93
www.implements.fun:
proto:
http: 80
脚本启动: startup.bat (需要与ngrok.cfg在同一文件目录)
@echo on
cd %cd%
#ngrok -config=ngrok.cfg -log=ngrok.log -subdomain=www 80
#ngrok -config ngrok.cfg start client
#ngrok -config ngrok.cfg start client client1 client2 test90 test91 test92 test93 www.implements.fun
#ngrok -config ngrok.cfg start test91
ngrok -config ngrok.cfg start www.implements.fun
客户端脚本及配置文件下载
链接:https://pan.baidu.com/s/1oPchz5c94Sr2omOJKUxc0g
提取码:vk4o
复制这段内容后打开百度网盘手机App,操作更方便哦