Skip to content

Instantly share code, notes, and snippets.

@dgoguerra
Last active August 29, 2015 14:21
Show Gist options
  • Save dgoguerra/42838efb9dbf8ebda1aa to your computer and use it in GitHub Desktop.
Save dgoguerra/42838efb9dbf8ebda1aa to your computer and use it in GitHub Desktop.
ngrok notes

Open an HTTP tunnel to localhost

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.

Open a ssh tunnel to localhost

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment