tunnelr GitHub

Put localhost on the internet through a VPS you already pay for.

tunnelr is one small binary. Run it as a server on a cheap VPS, run it as a client on your machine, and a public port on the VPS reaches a local port on your laptop.

INTERNET visitors 203.0.113.10:30185 CHEAP VPS tunnelr server :30185 public, forwarded :20185 control (WebSocket) tunnel YOUR MACHINE tunnelr client localhost:3000 behind NAT, no public IP

A visitor hits the VPS on the public port. The server hands the connection over the tunnel to the client, which opens a TCP connection to the local port. Many connections share one WebSocket.

One binary, two roles

tunnelr server installs itself as a systemd service and survives reboots. Without server it is the client.

Two open ports are enough

Cheap providers expose a couple of ports. One is the control port, the other is your public port. That is the whole requirement.

Reconnects on its own

Wi-Fi drops, laptop sleeps, the client backs off and comes back. A new client for the same port takes over the old one.

Saved connections

tunnelr add vps … once, then plain tunnelr reopens it. Only the path to the key file is saved.

Setup, in full

VPS once

$ curl -fsSL sobanieca.github.io/tunnelr/install.sh | bash
$ sudo tunnelr server -p 20185
  Address:   203.0.113.10:20185
  Key:       kD3xW9q1mZ8pR4tY7uH2cV6bN0aS5fGj
  Key file:  /root/.secret/tunnelr-key

Your machine whenever

$ curl -fsSL sobanieca.github.io/tunnelr/install.sh | bash
$ echo kD3x… > ~/.secret/tunnelr-key
$ tunnelr 203.0.113.10:20185 -p 30185:3000
  203.0.113.10:30185 → localhost:3000   Ctrl+C closes it

Install

curl -fsSL sobanieca.github.io/tunnelr/install.sh | bash

Same command on the VPS and on your machine: a single binary for Linux and macOS (x64 and arm64), no runtime needed. Debian is the tested server OS. Update it any time with tunnelr update. tunnelr --help lists every option and the small HTTP API for listing and closing ports.