![搭建内网穿透利器 ngrok-国外主机测评 - 国外VPS,国外服务器,国外云服务器,测评及优惠码](https://zhuji.vsping.com/wp-content/uploads/2023/04/147937407959735466-220x150.png)
搭建内网穿透利器 ngrok
虽然ngrok很久没有更新了,但是目前还是比较好用的内网穿透利器,这里我就来介绍下如何在centos 7上搭建ngrok服务端和客户端 1、环境安装: yum -y install gcc golang wget 2、下载ngrok: cd /usr/local/ git clone https://github.com/dollarphper/ngrok.git cd ngrok/ 3、生成证书: openssl genrsa -out rootCA.key 2048 openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=ileiming.com" -days 5000 -out rootCA.pem openssl genrsa -out server.key 2048 openssl req -new -key server.key -subj "/CN=ileiming.com" -out server.csr openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 5000 4、拷贝证书: cp rootCA.pem assets/client/tls/ngrokroot.crt cp server.crt assets/server/tls/snakeoil.crt cp server.key assets/server/tls/snakeoil.key 5、生成服务端文件: make release-server 6、生成客户端文件: # linux: GOOS=linux GOARCH=amd64 make release-client # windows: GOOS=windows GOARCH=amd64 make release-client # mac GOOS=darwin GOARCH=amd64 make release-client 7、服务端启动脚本: vi /usr/local/sbin/ngrok.sh #!/bin/bash /usr/local/ngrok/bin/ngrokd -log="/var/log/ngrok/ngrok.log" -domain="ileiming.com" -httpAddr=:80 -httpsAddr=:443 -tunnelAddr=:4443 1> /dev/null 2> /var/log/ngrok/ngrok.log & echo $! > /var/run/ngrok.pid 8、服务端创建启动服务: [Unit] Description=ngrok After=network.target [Service]...