How to access localhost using ngrok free account and dropbox over the internet (Ubuntu 16.10)

OS of my PC is Ubuntu 16.10

First install ngrok on the the PC  Please refer the official web site

Extract  the downloaded zip file in to the home directory of the PC

Now if you run ./ngrok http 80 you will get the ngrok panel as follws

Screenshot from 2017-03-21 00-00-55

ngrok running on the terminal

Screenshot from 2017-03-21 00-02-13

ngrok web interface

If you copy the Forwarding web links on the web browser of a remote computer ,local host of the forwarding computer will appear on the screen.

The main problem in the free ngrok is ,the forwarding link is not a fixed one .Every time you start ngrok ,you will get a different link address .Therefore you can not access the localhost of the computer ,without knowing the forwarding address .

If you can save the ngrok web interface as a pdf file and upload in to a free dropbox account ,you will be able to access it over the internet and connect with the link .

Therefore it is necessary to install dropbox on the hosting computer.Installation of  dropbox  can be easily done using the Ubuntu Software center .


 

wkhtmltopdf is installed for saving html files as pdf

 

sudo apt-get install wkhtmltopdf

 

In order to start dropbox , ngrok at the startup of the PC and saving ngrok forwarding links to dropbox and uploading to the cloud automatically , I have written a script shown below

 

Open the terminal and run

 

sudo gedit testngrok.sh

 

Copy the following script in to the testngrok.sh and save the file in the home directory

 


 

#!/bin/bash

dropbox start -i

gnome-terminal -e ‘./ngrok http 80 ‘

xdg-open http://127.0.01:4040/inspect/http

rm ~/Dropbox/Public/ngrok/*

sleep 20

wkhtmltopdf http://127.0.01:4040/inspect/http ~/Dropbox/Public/ngrok/ngrok.pdf

 


 

Then to make executable testngrok.sh run on th terminal

chmod +x ~/testngrok.sh

Now if you run ./testngrok.sh on the terminal ,dropbox and ngrok will 
start and the forwarding links are uploaded to the dropbox cloud.

If you want to start the above process at the startup of PC ,the script
has to be added in to the startup applications .
Screenshot from 2017-03-21 00-38-01

Adding the script to the menu launcher
Screenshot from 2017-03-21 00-40-46.png
Adding the script to the startup applications

When you start the computer the above script will activate automatically
and save the forwarding links in the dropbox cloud so that the localhost
can be accessed remotely.


Screenshot from 2017-03-21 00-45-24.png  

Saved forwarding links file on the dropbox folder of the local computer

Screenshot from 2017-03-21 00-48-06


Saved forwarding links in the dropbox cloud

If you place the cursor and press on the link you will be able to 
access the local host of the forwarding computer
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s