RemoHop

中文

Docs

Self-hosting the rendezvous server

The rendezvous server is light. A small VM is enough, for example an Oracle Cloud Always Free instance with 1 OCPU and 1 GB. Measured figures, not guarantees: about 17 MB RSS idle, about 70 KB per online host, about 85 MB with 1000 hosts online.

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

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

sudo install -m 755 remohop /usr/local/bin/remohop   # the unit's sandbox hides /home, /root and /tmp
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

Open UDP 21116, 21117 and the relay range in both places: the machine's firewall and the cloud provider's security list (Oracle Cloud security list, AWS security group, and so on). Clients reach the server directly over UDP; Cloudflare Tunnel does not carry UDP. Machines where only HTTPS gets out use the websocket bridge below.

Point clients at it and pin its key:

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

Networks that allow only HTTPS (websocket bridge)

CI runners, cloud containers and corporate networks often block UDP and let only HTTPS out, sometimes only through an HTTP proxy. For them the rendezvous server can also serve a websocket bridge, and both clients and hosts fall back to it by themselves:

remohop signal --relay --relay-ports 40000-40099 \
    --ws-listen 127.0.0.1:8080 --ws-real-ip-header CF-Connecting-IP

Serve it through a Cloudflare Tunnel (the UDP ports stay open as before; only the bridge goes through the tunnel). In cloudflared's config.yml:

tunnel: <tunnel-id>
credentials-file: /etc/cloudflared/<tunnel-id>.json
ingress:
  - hostname: relay.example.com
    service: http://127.0.0.1:8080
  - service: http_status:404

On the machines:

remohop config set signal relay.example.com:21116        # as before, for UDP
remohop config set signal-ws wss://relay.example.com/remohop/v1/udp
remohop config set signal-ws-access-id <client-id>.access
remohop config set signal-ws-access-secret-file /etc/remohop/ws-secret   # or REMOHOP_SIGNAL_WS_ACCESS_SECRET

The bridge was tested end to end in network namespaces (UDP dropped except DNS, then only an HTTP CONNECT proxy allowed) and with in-process servers; it has not yet been tried through a real Cloudflare tunnel.

Running a public server

To offer the relay to people you do not know, for example as the built-in default of your own remohop builds, give it access controls and a budget. Rendezvous (IDs, presence, hole punching) stays open to everyone; only the relay is limited. For an Oracle Cloud Always Free micro VM 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
sudo remohop signal --status --data /var/lib/remohop-signal --relay-monthly-gb 8000

public-server.md is the full reference for these options; it also covers what such an operator can and cannot see, and has a privacy notice template.