To open an HTTP tunnel to localhost on port 80:
ngrok http 80
If the forwarding setup is http://1d3a3ba5.ngrok.io -> localhost:80
, access it with the URL http://1d3a3ba5.ngrok.io
.
To set up the Host header (when the webserver serves virtual hosts):
ngrok http --host-header=rewrite example-hostname.com:80
The forwarding setup will look like: http://1d3a3ba5.ngrok.io -> example-hostname.com:80
.
To open a ssh tunnel to localhost on port 22. Requires being registered, and adding the account auth token (ngrok authtoken TOKEN
).
ngrok tcp 22
If the forwarding setup is tcp://0.tcp.ngrok.io:52167 -> localhost:22
, access from anywhere with:
ssh 0.tcp.ngrok.io -p 52167