HTTP Tunnels

To set up an HTTP tunnel to port 8080, request a port forward from port 80:

bash
ssh -R 80:localhost:8080 localhost.run

localhost.run forwards HTTP traffic down your tunnel to your app, and automatically adds encrypted HTTPS endpoints for your clients.

Prefix your domain with https:// to access the tunnel over HTTPS — localhost.run unwraps the encryption and sends plain HTTP requests to your app.

Proxy headers

Reverse proxy headers are added to HTTP requests automatically: X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Proto and the newer Forwarded header.

They can be turned off with a command line option.

TLS connections to non-HTTP apps

Clients connecting to port 443 over TLS don't have to speak HTTP — any protocol from a TLS-capable client is sent down your tunnel.

For example, a PostgreSQL server on port 5432:

bash
ssh -R 80:localhost:5432 localhost.run

TLS clients can then connect to the tunnel's domain on port 443. Your app should listen for plain TCP; localhost.run handles certificates and decryption.

Info: currently only Custom Domains can carry non-HTTP protocols.