01/08/2015 - LINUX, MAC
We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.
If you want to access your local applications that run on local servers and accessible via
http://localhost from anywhere in the world via the Internet then use ngrok.
Download it from here.
Assuming that it is on your desktop so run with command below. If you're in the same directory as ngrok then run
./ngrok http 80 command.
inanzzz@inanzzz:~$ ~/Desktop/ngrok http 80
ngrok by @inconshreveable (Ctrl+C to quit)
Tunnel Status online
Web Interface http://127.0.0.1:4040
Forwarding http://f71186f4.ngrok.io -> localhost:80
Forwarding https://f71186f4.ngrok.io -> localhost:80
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
If you call
https://f71186f4.ngrok.io from your browser, you'll see that your localhost is exposed to the Internet now. Ngrok will list all requests like below. For the virtual hosts for your local applications, you might need to add
ServerAlias *.ngrok.io in their conf files.
GET / 200 OK
GET /icons/back.gif 200 OK
GET /local/ 200 OK
POST /student/ 204 Accepted
GET /info.php 200 OK
GET /favicon.ico 404 Not Found
GET /icons/unknown.gif 200 OK
GET /icons/folder.gif 200 OK
GET /icons/blank.gif 200 OK
GET / 200 OK