Have you ever needed to show your progress to a client, but didn’t want to push to a staging/test environment? I know I have. Passing the minimum three arguments on the command line can expose a local environment in seconds with Ngrok.
We found ourselves in a situation in which our dev/test environments bottle necked our progress. Ngrok created the possibilities to use our local-host to test and work the bugs out on a specific device.
Quick setup guide for testing local code on external devices
- Download the application
- Install $
- Personally I like ngrok in my home directory
- Test install $
- If localhost:3000 is my local server then type $
./ngrok http 3000to launch ngrok.
- Initial stats will show you how to access http/https address. Also you can watch your servers head/stats by going to http://127.0.0.1:4040/status
Explore more possiblities visit ngrok docs.
Bash Argument Examples
Custom subdomain names
ngrok http -subdomain=yourcoolsite 80
Set a password
ngrok http -auth="username:password" 8080
ngrok http -host-header=rewrite yourcoolsite:80
ngrok http -subdomain=local-host -host-header=rewrite local-host.com:80
Check out this video which helped sell me on the idea of giving it a try.