Relay is a TCP tunneling service. Unlike many other services on the market, it is open-source and free to use (with some limitations, of course).
We also plan to offer unique features, such as persistent domains, so your friends won't have to update the URL every time they want to visit your site.
Run the one-liner installer. It downloads the correct binary for your OS and architecture and places it in /usr/local/bin:
curl -fsSL https://raw.githubusercontent.com/InvalidJoker/relay/main/install.sh | shTo install a specific version:
RELAY_VERSION=v0.1.0 curl -fsSL https://raw.githubusercontent.com/InvalidJoker/relay/main/install.sh | shTo install to a custom directory:
RELAY_INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/InvalidJoker/relay/main/install.sh | shOpen PowerShell and run:
irm https://raw.githubusercontent.com/InvalidJoker/relay/main/install.ps1 | iexThe binary is installed to %LOCALAPPDATA%\relay\bin and added to your user PATH automatically.
To install a specific version:
irm https://raw.githubusercontent.com/InvalidJoker/relay/main/install.ps1 | iex -Version v0.1.0Requires Rust (edition 2024 / stable toolchain):
git clone https://github.com/InvalidJoker/relay.git
cd relay
cargo build --release -p relay_cli
# binary is at target/release/relayBefore using Relay you need to authenticate with the server. This uses the OAuth 2.0 Device Code flow — no browser redirect required:
relay loginYou will be shown a short code and a URL. Open the URL, enter the code, and the CLI will save your credentials automatically to ~/.config/relay.toml.
To log in against a self-hosted server:
relay login https://your-relay-server.example.comForward a local HTTP server on port 3000 to a public URL:
relay http 3000Pick a custom subdomain (if available):
relay http 3000 --subdomain myappProtect the tunnel with basic auth:
relay http 3000 --username alice --password secretSave the config so you can restart it later with relay run:
relay http 3000 --subdomain myapp --saveForward a local TCP port (e.g. a game server on port 25565):
relay tcp 25565Request a specific remote port:
relay tcp 25565 8080Save the config:
relay tcp 25565 --saveIf you saved a config with --save, restart the tunnel without repeating all flags:
relay runUse a custom config path:
relay run --path /path/to/relay.tomlA relay.toml file looks like this:
# HTTP example
relay_type = "Http"
port = 3000
domain = "myapp"
# TCP example
# relay_type = "Tcp"
# port = 25565
# remote_port = 8080- Bore — Huge thanks to Bore for providing a great example of how to build a TCP tunneling service. A lot of inspiration was taken from their codebase; highly recommended if you're interested in building something similar.
