内网:
- 得到ngrok程序。
- 建立ngrok.cfg文件,写入下面内容
12server_addr: allstack.net:4443trust_host_root_certs: false - 建立ngrok_allstack_net.sh文件,写入下面内容
12path=/home/pi/ngrok_allstack_netnohup $path/ngrok_arm -config $path/ngrok.cfg -subdomain pioc 80 >/dev/null 2>&1 &
并chmod a+x ngrok_allstack_net.sh - 打开/etc/rc.local文件写入一行,使得ngrok程序能开机运行:
1cd /home/pi/ngrok_allstack_net && nohup ./ngrok_allstack_net.sh >/dev/null 2>&1
外网:
- 建立ngrokd.sh,写入以下内容:
12path=/home/xxx/ngroknohup $path/bin/ngrokd -tlsKey=$path/server.key -tlsCrt=$path/server.crt -domain="allstack.net" -httpAddr=":8280" -httpsAddr=":8243" >/dev/null 2&1 & - 打开/etc/rc.local加入一行:
1cd /home/xxx/ngrok && nohup ./ngrokd.sh >/dev/null 2>&1 &
重启完成。
ngrok git: https://github.com/inconshreveable/ngrok
参考:https://blog.csdn.net/zhangguo5/article/details/77848658?utm_source=5ibc.net&utm_medium=referral
最后记录一下网上免费的ngrok服务器:
https://www.ngrok.cc sunny: python sunny.py –clientid=xxx
http://ngrok.ciqiuwl.cn/
Nginx+Ngrok实现80端口服务器+80端口内网穿透: https://blog.csdn.net/muumlover/article/details/53075200