Self-compiling Ngrok server

Source: Internet
Author: User

Reprint: http://www.haiyun.me/archives/1012.html

First install the GO environment, http://www.haiyun.me/archives/1009.html

1234 cd/usr/local/src/git clone https://github.com/inconshreveable/ngrok.gitexport GOPATH=/usr/local/src/ngrok/exportNGROK_DOMAIN="haiyun.me"

Generate a self-signed SSL certificate, Ngrok SSL Encrypted connection:

123456789101112 cd ngrokopenssl genrsa -out rootCA.key 2048openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pemopenssl genrsa -out device.key 2048openssl req -new -key device.key -subj "/CN=$NGROK_DOMAIN" -out device.csropenssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000cp rootCA.pem assets/client/tls/ngrokroot.crtcp device.crt assets/server/tls/snakeoil.crt cp device.key assets/server/tls/snakeoil.keyGOOS=linux GOARCH=386make cleanmake release-server release-client

If you stay in Go get gopkg.in/yaml.v1 reference: https://www.haiyun.me/archives/1011.html
Start server:

1 bin/ngrokd-domain="$NGROK_DOMAIN"-httpAddr=":8000"

Cross-compiling the Windows client, it is best to install the latest version of Golang, using the Yum installation has been compiled does not pass.

1234 cd/usr/local/go/src/GOOS=windows GOARCH=386 CGO_ENABLED=0 ./make.bashcd -GOOS=windows GOARCH=386 makerelease-server release-client

Client Configuration:

12345678910111213 server_addr: "haiyun.me:4443"trust_host_root_certs: falsetunnels:  http:    subdomain: "example"    auth: "user:12345"    proto:      http: "80"  ssh:    remote_port: 2222    proto:      tcp: "22"

To start the client:

1 bin/ngrok-config ngrok.conf start http ssh

Note that all domain must be consistent, or a certificate error will occur:

1 Failed to read message: remote error: bad certificate

Self-compiling Ngrok server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.