This is a fork project for ngrok, make its easier to use.
PLEASE READ THIS PARAGRAPH FIRST, VERY IMPORTANT !!!
To simplify the ngrok client build/usage, the tls verify logic will be skipped, so your traffic is in-secure, please DO NOT use this service to transfer sensitive/production data.
The server will generate a self-signed ssl cert as its tls encryption cert, and client will connect to server without ssl chain verify (but still transfer data under tls protection), in this solution, the users of self hosted service doesn't need to build the client/server again and again.
download binary from snapshot build
then start your tunnel with command
ngrok --serveraddr self_host_domain.com:4443 81
- the serveraddr is mandatory for your own server
- format:
self_host_domain:transfer_port
, defaultly, the transfer port should be4443
- your service provider will tell you the
serviceaddr
- format:
- the second parameter
81
is your local service port- format is same with
serviceaddr
- you can expose any services in your local network like
192.168.3.24:3000
- format is same with
another way: just run docker build -t ngrok -f client.Dockerfile .
to build ngrok client image
run following command in your server
docker run --name ngrokd -d --restart=always -p 4080:80 -p 4443:4443 -e DOMAIN=self_host_domain.com theosun/ngrok-fork
- you must create domain & sub-domain DNS records for your server firstly
- self_host_domain.com -> your server ip
- *.self_host_domain.com -> your server ip
- the DOMAIN environment variable is mandatory
- DOMAIN env should be the root domain of your server, like
self_host_domain.com
- DOMAIN env should be the root domain of your server, like
- port 4080, the http service port
- port 4443, the ngrok transfer port, the client users need to get this port to setup their tunnels
- setup reverse proxy for the ngrok http service port
(first of first, you should have your own domain)
just ref this doc
*.your_host_domain:443 {
gzip
proxy / http://127.0.0.1:4080 {
transparent
websocket
}
tls wildcardcertpath wildcardcertkeypath
}
for other server like nginx
, you can find many many docs from search engine.