github下载
https://github.com/inconshreveable/ngrok.git
执行
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=ngrok.liaosearch.com" -days 5000 -out
rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=ngrok.liaosearch.com" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
复制ssl文件
cp rootCA.pem assets/client/tls/ngrokroot.crt
cp device.crt assets/server/tls/snakeoil.crt
cp device.key assets/server/tls/snakeoil.key
打包生成linux端的客户端和服务器端
make all
生成mac客户端
GOOS=darwin GOARCH=amd64 make release-client
启动服务端
nohup ./ngrokd -domain="ngrok.liaosearch.com" -httpAddr=":8001" -httpsAddr=":8443" -tunnelAddr=":8083" > log.file 2>&1 &
客户端配置信息
server_addr: "ngrok.liaosearch.com:8083"
trust_host_root_certs: false
tunnels:
http:
subdomain: "www"
proto:
http: "80"
启动客户端
./ngrok -config=config.cfg start http