Skip to content

Networking Modes

Kheopsian edited this page Jul 29, 2026 · 2 revisions

Networking Modes

Each engine reaches the swarm one of four ways. Pick per your setup; they're per-engine, so a monolith's race and hoard can differ.

Direct (default)

Set listen_port and forward it on your router. Nothing else. This is what the template ships.

SOCKS5 egress

Set socks5_outbound_host / socks5_outbound_port. Outbound peer and tracker traffic exits through the proxy; inbound is still direct (so you still forward listen_port). Good for routing egress through a VPS without touching inbound.

PROXY-v2 relay (change your public IP without a VPN)

Put the companion hydra-relay on a cheap VPS. Inbound peers hit the VPS (haproxy + PROXY protocol v2) and land on Hydra with their real IP preserved; socks5_outbound_* sends egress out the same VPS. Net effect: your seedbox advertises the VPS IP, in both directions, with no L3/VPN tunnel — just 12 bytes of PROXY-v2 header, no MTU or kernel module cost.

Keys: listen_port_proxy_v2, listen_addr_proxy_v2, proxy_v2_trusted_sources (the relay's IP, so the header is trusted).

Why it beats a WireGuard tunnel for this job: no tunnel to keep up, no MTU issues, and peers' real IPs survive (a plain SOCKS/VPN egress hides them).

gluetun / dynamic forwarded port

Run an engine inside a VPN container whose forwarded port rotates. Hydra rebinds the listener without a restart — torrents and live peer connections stay up. Two ways to push the new port, no extra component:

  • CLI (works on any node, including a headless --agent-only with no HTTP API): hydra set-listen-port <engine-socket> <port>
  • HTTP (monolith / front): POST /api/{race,hoard}/listen-port {"port":N}

Wire it to gluetun's own hook, exactly like people do for qBittorrent:

# gluetun service
environment:
  - VPN_PORT_FORWARDING=on
  - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'hydra set-listen-port /config/hoard.sock {{PORTS}}'

⚠️ One forwarded port serves one engine. Two engines are two processes and cannot share an inbound TCP port. If your VPN forwards only a single port, do not point it at both — run one engine per gluetun instead (Deployment Topologies).

Advanced keys (listen_port_proxy_v2, socks5_outbound_*, …) are opt-in and off by default.

Clone this wiki locally