Authentication logic is copied from https://github.com/prikevs/ngrok
Free online SSL cert: https://punchsalad.com/ssl-certificate-generator/
- yum/brew install golang
- yum/brew install mercurial
- git clone https://github.com/kjstart/ngrok
- cd ngrok
- make release-all
- cd bin
- 申请免费泛域名SSL证书步骤在最后,泛域名只支持通配一级.
vi ngrok_secrets
alvin Passw0rd
sudo ./ngrokd -tunnelAddr=":8080" -secretPath="./ngrok_secrets" -domain="domain.com" -tlsKey="./privkey.pem" -tlsCrt="./fullchain.pem"
vi confgi.yml
server_addr: domain.com:8080
auth_token: alvin:Passw0rd
trust_host_root_certs: true
http_proxy: http://proxy:80
./ngrok -config=config.yml -subdomain=test 8888
- git clone https://github.com/certbot/certbot.git
- ./certbot-auto certonly --manual --preferred-challenges=dns --email info@domain.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d *.domain.com -d domain.com
- 期间会要求重复添加同名的TXT类型记录到域名上,两条记录都要保留到验证结束.
- 根据提示复制声称的privkey.pem和fullchain.pem
- 泛域名只支持通配一级,比如*.test.com的证书不能用于*.sub.test.com
ngrok - Introspected tunnels to localhost (homepage)
ngrok is a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. ngrok captures and analyzes all traffic over the tunnel for later inspection and replay.
ngrok 2.x is the successor to 1.x and the focus of all current development effort. Its source code is not available.
NOTE This repository contains the code for ngrok 1.x.
ngrok 1.x is no longer developed, supported or maintained by its author, except to ensure that the project continues to compile. The contribution policy has the following guidelines:
- All issues against this repository will be closed unless they demonstrate a crash or other complete failure of ngrok's functionality.
- All issues against this repository are for 1.x only, any issues for 2.x will be closed.
- No new features will be added. Any pull requests with new features will be closed. Please fork the project instead.
- Pull requests fixing existing bugs or improving documentation are welcomed.
ngrok.com ran a pay-what-you-want hosted service of 1.x from early 2013 until April 7, 2016. Afterwards, it only runs 2.x service.
DO NOT RUN THIS VERSION OF NGROK (1.X) IN PRODUCTION. Both the client and server are known to have serious reliability issues including memory and file descriptor leaks as well as crashes. There is also no HA story as the server is a SPOF. You are advised to run 2.0 for any production quality system.
- Expose any http service behind a NAT or firewall to the internet on a subdomain of ngrok.com
- Expose any tcp service behind a NAT or firewall to the internet on a random port of ngrok.com
- Inspect all http requests/responses that are transmitted over the tunnel
- Replay any request that was transmitted over the tunnel
- Temporarily sharing a website that is only running on your development machine
- Demoing an app at a hackathon without deploying
- Developing any services which consume webhooks (HTTP callbacks) by allowing you to replay those requests
- Debugging and understanding any web service by inspecting the HTTP traffic
- Running networked services on machines that are firewalled off from the internet