Ngrok — Publish localhost securely

Ngrok allows users to deploy a secure tunnel to your local box. This allows users to show off projects, or get feedback without the hassle of deploying the application or sharing local network ips.

Ngrok acts as a NAT server sitting between your localhost and the internet. Ngrok generates http endpoint links like http://f7f49fde.ngrok.io/.

To Get Started with ngrok.io Visit.

For a quick taste of ngrok use the gist below. Make sure to use linux or mac.

curl https://gist.githubusercontent.com/gabber12/8109d10ba732ac380502135489b28c97/raw/2811ebee68ce8ecefbdc37d54ec1805812427544/ngrok-demo.sh | bash -s linux
 

 The snippet creates a Hello World flask application and intializes a ngrok tunnel.Once ngrok connects you can open the endpoint to access the application.

Ngrok handles a bunch of other stuff like

  • Authentication — Signup on ngrok.io and save auth token by ngrok authtoken {token}
  • Protocols — Out of the box ngrok allows for HTTP TLS and tcp based tunnels.
  • Custom domains — Custom domains can be reserved on ngrok by upgrading from free plan.

Ngrok also provides a neat dashboard to monitor account tunnels.

I found ngrok pretty useful for getting feedback on early stage projects and debugging mobile apps by routing traffic to a local setup.


Originally published at Experiments and stumbles.