Ngrok
Ngrok allows us to expose our device port to world with NAT or firewall tunnel.
It helps us share a website running on local machine with the world, or creating a temporary backend to test app from internet , many more.
Ngrok provides a free plan with 40 connects/minute and 1 online ngrok process, for more details visit here
Download & Installation
Download Ngrok from official Download page here
Make sure to create account / signup with Ngrok and copy authtoken value
Installation Commands
1
2
3
4
unzip /path/to/ngrok.zip # Unzip Downloaded File
./ngrok authtoken <your_auth_token> # Add Authentication token to use ngrok service
./ngrok help # Getting Help
./ngrok http 80 # Exposing port 80
Tutorial
Official Docs here & for official Tutorial check here
for tutorial creating a python file server with http.server and exposing it with ngrok
1
2
3
4
5
6
mkdir test # Creating Demo folder
cd test
echo "<h1>Hello world</h1>" > index.html # Creating demo file
# Starting python server
python -m http.server
now you can check http://localhost:8000 returning Hello world
now we can expose to world with ngrok
1
ngrok http 8000 # Staring ngrok on running port 8000
Now congratulation you have created your own webserver exposed to world.