Skip to content

Instantly share code, notes, and snippets.

@sandheepg
Last active March 9, 2017 19:01
Show Gist options
  • Select an option

  • Save sandheepg/779c41b7e7e84d4f9ed4d2830f5b9859 to your computer and use it in GitHub Desktop.

Select an option

Save sandheepg/779c41b7e7e84d4f9ed4d2830f5b9859 to your computer and use it in GitHub Desktop.
Access localhost online

To access application hosted locally over the network using HTTP, we can use ngrok

Download ngrok zip file from the website into your local machine and unzip. That gives you an executable file. Navigate to the executable file, and run

ngrok http 80
# OR
./ngrok http 80
# where 80 is the port on which the web server is listening

This should open secure tunnel to localhost and flash the ngrok URL that points to localhost. Use the URL to access the localhost from anywhere. Obviously, the URL works only when the ngrok is running locally.

There are alternatives to ngrok if you would like to explore. Forward for example has paid plans and works well w/ virtual hosts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment