RemoHop

中文

Self-hosting the rendezvous server

RemoHop has no built-in default server. The rendezvous server (remohop signal) lets two machines find each other: it assigns IDs, tracks presence and passes candidate addresses. It is light enough for the smallest VM you can rent. Session content does not pass through it unless you turn the relay on.

How big a machine

Measured figures, from remohop help signal and from measurement, not guarantees: about 17 MB of memory when idle, about 70 KB per online host, about 85 MB with 1000 hosts. An Oracle Cloud Always Free instance with 1 OCPU and 1 GB is enough. The relay uses roughly 1% of a CPU core per 10 Mbit/s.

Run it

remohop signal --relay --relay-ports 40000-40099
remohop signal --print-firewall --relay --relay-ports 40000-40099
remohop signal --show-key

To install it as a hardened systemd service (Linux only, needs root):

sudo install -m 755 remohop /usr/local/bin/remohop
sudo /usr/local/bin/remohop service install --role signal --relay --relay-ports 40000-40099
remohop service status --role signal
sudo remohop signal --show-key --data /var/lib/remohop-signal

UDP 21116, 21117 and the relay range must be open in two places: the machine's own firewall, and the cloud provider's security list (Oracle Cloud's security list, an AWS security group, and so on). Cloudflare Tunnel does not forward UDP, so the rendezvous server itself cannot sit behind a tunnel.

Point clients at it

remohop config set signal HOST:PORT
remohop config set signal-pin KEY

You can also compile the address and key into the binary, so that the remohop you hand out has a default server:

go build -ldflags "-X github.com/readori/RemoHop/internal/dial.DefaultSignal=HOST:PORT \
  -X github.com/readori/RemoHop/internal/dial.DefaultSignalPin=KEY" -o remohop ./cmd/remohop

Networks that let only HTTPS out: the websocket bridge

CI runners, cloud containers and corporate networks often block UDP. The server can also serve a websocket bridge, and clients and hosts fall back to it automatically when UDP rendezvous has not answered within 4 seconds:

remohop signal --relay --relay-ports 40000-40099 \
    --ws-listen 127.0.0.1:8080 --ws-real-ip-header CF-Connecting-IP
remohop config set signal relay.example.com:21116
remohop config set signal-ws wss://relay.example.com/remohop/v1/udp

Hole punching is impossible through the bridge, so these sessions always use the relay, which must be on. Encryption, the password exchange and server key pinning are exactly as over UDP: the bridge and any proxy in front of it see QUIC ciphertext only. The bridge has been tested end to end in network namespaces, but not yet through a real Cloudflare tunnel.

Offering a relay to the public

If you offer the relay to people you do not know, for example as the default server of your own build of remohop, give it access controls and a traffic budget. The rendezvous service stays open to everyone and keeps its own per-address rate limits; only the relay is restricted. For an Oracle Cloud free instance with 10 TB of outbound traffic a month:

sudo remohop service install --role signal --relay --relay-ports 40000-40099 -- \
    --relay-kbps 2000 --relay-per-source 2 --relay-monthly-gb 8000 \
    --relay-deny /etc/remohop/relay-deny \
    --ws-listen 127.0.0.1:8080 --ws-real-ip-header CF-Connecting-IP
FlagWhat it does
--relay-kbps 2000Per-session cap for anonymous sessions (2 Mbit/s). Traffic over the cap is paced, not cut off.
--relay-per-source 2At most two relayed sessions at a time per address (an IPv6 address counts by its /64). Both peers count. A slot is freed as soon as the session closes.
--relay-monthly-gb 8000Monthly relay budget, per UTC calendar month. At 80% anonymous sessions get half their rate. At 100% new anonymous sessions are refused. At 110% all new sessions are refused. The count survives restarts.
--relay-deny FILENo relay for the addresses, networks and identity keys listed. Listed keys also cannot register as hosts. The file is re-read within 10 seconds of a change.

With accounts on (--accounts, which needs SMTP), --relay-account-kbps gives verified account members a higher rate, and --relay-for accounts relays only for them. Membership is proven by a signature; a claim by the client counts for nothing.

To see usage: sudo remohop signal --status --data /var/lib/remohop-signal --relay-monthly-gb 8000. Once an hour the log has a relay summary line with session counts, bytes and refusals by reason. It contains no addresses.

What an operator can and cannot see

The server never sees session content, cannot learn passwords and cannot join a session. It does see metadata:

What the server logs by default: hosts going online and offline (ID and address), relay sessions starting and ending (both addresses, tier, rate, duration, bytes), websocket connections opening and closing, account logins, and the hourly summary. Logs go to the systemd journal. Set a retention period you can defend, for example MaxRetentionSec=14day in /etc/systemd/journald.conf, and state it in your privacy notice.

The public server reference document has a privacy notice template you can adapt. This site's own privacy policy follows it.

Operators and the AGPL

Running an unmodified remohop signal adds no obligation. If you modify it and let other people use it, section 13 of the AGPL-3.0 requires you to offer those users the source of your modified version. If you would rather not publish your changes, a commercial license is available.