Richard Bucker

ngrok in production and other uses

Posted at — Dec 24, 2014

I recently came across ngrok and while the demo that I watched was recommending it development environment I think it might have a few more use cases.The example that was given: You have implemented some application or feature that you want to share but the user is remote, outside the firewall, or asking the user to update his hosts file make the process painful.Enter ngrok.Register with ngrok. Then download their client application. Launch your application in localhost mode. Then configure and launch the ngrok client. The ngrok client will open a long poll connection to the ngrok server. You give the user a target URL to enter into his browser… and voila.The user’s browser connects to the ngrok server, which forwards the message request to the ngrok client, which then opens a connection to the configured client application. The experience is complete.What makes this model desirable is several fold [a] all applications would be configured as localhost support the just-one executable model [b] (a) supports a similar docker model [c] some firewall routers need to restart or [d] router risk associated with firewall rules [e] this is an inside out connection rather than an outside in.It’s very obvious how this works in development. It’s just a way to share.In CI, continuous integration, this solution would promote a dynamic network structure that would require minimal care and feeding. With a touch of good luck would not require massive DNS changes.** I have no idea what the capacity requirements are and whether it’s fast enough for production but it’s exciting as part of a complete solution.** ngrok has logging and replay features which would need to be disabled in production. Additionally there is no mention of SSL. I presume that ngrok would act as a man in the middle so it would be better inside your firewall.