You probably know how to run anything on localhost. But what if you could share what's running on localhost to the world? It's possible, through local tunneling software.
It's no magic by the way. It does this with the help of a "client" software installed on your computer. Since it's installed on your computer it can access your local stuff. It also has a server side program that sends the requests to that client software. The client then passes the requests to the local server and returns the results to the server to be shown to the user.
With the help of these local tunneling thingies you can let clients try your software that you're currently developing before they buy into it, or just access a software from outside your network when you need it - all without getting things into a server and doing complex setups.
There's one catch though, this will work only when you're running the program... . Think of this as a temporary solution to access your servers in a zip! Some might even use it for low traffic cases, who knows!pgrok
ngrok used to be Free Software
. But they stopped publishing their source code. So someone forked the last available source code of ngrok, named it "pgrok" and offered us to use it for free. You can download it from pgrok's release page
and install it like this:
# Debian, Trisquel etc.
sudo dpkg -i /path/to/pgrok_*_linux_amd64.deb
# Fedora, OpenSUSE etc.
sudo rpm -i /path/to/pgrok_*_linux_amd64.deb
On Void Linux/Ymir, I had to do this:
sudo xbps-install binutils
ar x /path/to/pgrok_*_linux_amd64.deb data.tar.xz
sudo tar xvf data.tar.xz -C /
You could probably use similar commands on Arch Linux/Parabola.Usage:
If you have your application running on 8080 port on localhost, you can run this:
But it will give you a random URL everytime. You can specify a subdomain like this:
pgrok -subdomain=jessieslocalhost 8080
It will let you access your local application from
. As long as you have pgrok running, the link will work anywhere! Without needing any VPS, servers or anything!This is a summary of the original article here. The article has more FOSS options listed.