相信大家在工作和学习都避免不了快速外网调试。比如微信支付、支付宝支付,消息推送,短信发送,邮件发送等等。都需外网能访问你本地服务器进行调试。
软件下载地址:https://www.ittun.com/
解压软件: config.yml ngrok.exe startup.bat
server_addr: "ittun.com:44433"
tunnels:
ssh:
remote_port: 51001
proto:
tcp: ":22"
web:
subdomain: test
root: "D:/go/ittunNgork/bin/html/"
proto:
http: ":8080"
web2:
hostname: pimwx2
root: "D:/java/nginx-1.0.11/html"
proto:
http: ":80"
以上的配置指定静态文件访问而已,接下来我们修改这个文件yml,改成我们想要的内网穿透,以便外网正常访问。
server_addr: "ittun.com:36415"
trust_host_root_certs: false
tunnels:
xqq:
subdomain: "xiequanquan"
proto:
http: 80
1、修改.yml文件之后,接下来修改批处理文件startup.bat
ngrok -config ittun.yml start xqq
当然你也可以直接在cmd命令窗口进入该文件目录下运行。
通过运行ngrok.exe加载配置.yml文件。
运行结果如下:
http://xiequanquan.ittun.com -> 127.0.0.1:80
外网直接访问:http://xiequanquan.ittun.com 内网可以访问:127.0.0.1:80
我一直使用目前没有掉线过。