When working on web development, there are times when we need to share our local changes quickly. If the change is small, deploying to web server by generating a war file would consume a lot of time. There needs to be a quick way to expose web server(running locally) publicly so that clients can view the changes and provide immediate feedback.
Ngrok comes to the rescue:
Ngrok creates a tunnel from a dynamically assigned public ip to a locally running web service. Main use of ngrok is to publicly expose a local web server.
On linux, we can simply download the zip file from https://ngrok.com/download, extract it and then execute the script file to launch ngrok. Once ngrok is installed, we can execute the following command:
./ngrok http "portNumber"
Let’s say we are running tomcat server locally. So, we can use :
./ngrok http 8080
The screen below would show up when the above command is successfully executed:
We need to copy the http link and share it with our clients.
That was all folks!