Tunnel My…

WordPress

WordPress is configured to run under a specific URL, usually http://localhost — great locally, not on the internet. Change the site URL to your tunnel's domain.

Tip: free domains change over time, and WordPress URL updates are lengthy. A Custom Domain gives a stable name you configure once.

Caution: for free domains you can explore the relative URL plugin and set WP_HOME and WP_SITEURL to 'https://' . $_SERVER['HTTP_HOST'] — but understand the security implications of trusting the Host header.

Favourite web framework

Seeing requests to localhost:{port} in your browser dev tools when browsing through localhost.run? Check your framework's reverse proxy settings. More in the FAQ.

SSH servers

With a custom domain you can tunnel to an SSH server using stunnel on the client.

  1. On the SSH server, connect the tunnel (keep it running):
bash
ssh -R tunnel.example.com:80:localhost:22 plan@cd.localhost.run
  1. On the client, install stunnel, which wraps TCP in TLS.
  2. Create stunnel.conf:
ini
foreground = yes
pid = ./stunnel.pid
[lhr]
client = yes
accept = localhost:2222
connect = tunnel.example.com:443
  1. Run stunnel stunnel.conf and keep it running.
  2. Connect: ssh localhost -p 2222.