Hallow friends,in this blogpost we are going to talk about the installation process of ngrok in Termux,use of ngrok and how we can access our localhost from any where using ngrok.In this post you will get step by step all necessary commands to install and use of ngrok in Termux without any error.So let's start
What is ngrok
Ngrok is a cross platform application that is used for the port forwarding.Its reverse proxy software that establishes secure tunnels from a public endpoint such as internet to the locally running network services while capturing all the trafic for the details inspection and replay.
Whenever you create any website or any application and you want it to execute by someone else all over the internet or anywhere in the world in that case if you have the web server so it can be only accesses using your local internet and only into your internet system.So to get it accessed all over the public network you have to do the port forwarding and you have to do it in to the router.You can also do it using ngrok by following some simple steps.
Installating ngrok and use of ngrok are very simple.
How does ngrok work
Ngrok will provide you the URL which will map with your localhost and when any user try to access that particular URL it will redirect to your localhost.
As an example ,if you have created any APK file and you upload it over the web and when user access it and execute it so what happened is as while creating the APK file you mentioned your localhost order and you get from the ngrok as a localhost and you also mentioned the port number so when the user executes that file it redirects to your localhost which it is mapped with.
How to Download ngrok in Termux / Linux
To download ngrok in Termux use the following commands step by step
1.open your web browser and search ngrok.com
2.Go to the first website and sign up with your Name,Email and Password
3.ngrok.com will send you a verification mail you have to verify it by clicking on the link which you would have received in your Email.
4.Then you will get an API key from ngrok.com copy that link
Now open your Termux and use the following commands
1.pkg update && pkg upgrade
2.pkg install wget
3.pkg install unzip
4.wget https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm.tgz
5.tar -xvf ngrok-v3-stable-linux-arm.tgz
6.Then paste your API key which you have copied .
Now your ngrok is ready for port forwarding
How to make tunnels using ngrok
We can create TLC,TCP and HTTP tunnels using ngrok . Before creating a tunnel make sure your personal mobile HOTSPOT is on or not.If your Hotspot is off then turn it on otherwise may be your link will not generate.
Command for start a TCP tunnel
./ngrok tcp <port>
./ngrok tcp 45
Command for start a http tunnel
./ngrok http <port>
./ngrok http 8080
Ngrok not working problem
If your ngrok is not working properly or ngrok not generating any link then it may possible that some minor mistakes have been done by you.
1.Make sure your mobile HOTSPOT is ON
2.Make sure your data connection is On
3.Make sure that all of the commands taken by you are correct
See live requests
After starting ngrok if you want to see live requests on your tunnels then you have yo visit http://127.0.0.1:4040
0 Comments