Sharing your Local Web App Globally

Suppose you're developing a web application, or running a local service like writefreely. It works great on localhost, now what about publishing it? You install it to a remote server, hide it behind the reverse proxy (like caddy), and lo and behold! It's available to everyone on the internet 24x7. As you modify, update and develop the application, you have to synchronize the remote version, upgrade and maybe restart it.

It can be a bit tedious even if you already have several servers running caddy or nginx. And it's absolutely wrong if you have a reason to share the thing running locally instead of running its snapshot remotely.

Let's start caddy to share a folder with documents:

caddy file-server -l 127.0.0.1:5000 -b -r ~/My_project/Docs

We go to localhost:5000 and see the folders and files. How can we share this without “uploading” anything?

Okay, that's how I do it:

Now the good news:

I offer a service that works exactly this way, only you don't have to configure any remote machine.

The bad news:

It's not free. I charge 1000 satoshi per SSH client key to get your app forwarded to my subdomain. You pay when first logging in with the key, you have a fixed subdomain for that key until the project dies.

Try this (note remote port 80):

ssh -R80:localhost:5000 app@ssh.my-ns.me 

For the first login, a lightning invoice for 1000 sats will be created for you. After you pay the invoice, a random four-letter subdomain will be assigned to your SSH key, let's say it's zzvb. As long as SSH is running, visiting https://zzvb.app.my-ns.me has the same effect as visiting http://localhost:5000.