WireRelay: Bounded, Payload-Opaque UDP Relay
A high-performance, resource-bounded UDP relay designed specifically for WireGuard and AmneziaWG infrastructure. Forwards datagrams unchanged to fixed remote backends with strict session tracking, automatic DNS refresh, transactional configuration reloads, and systemd integration.
Deterministic UDP Relaying Architecture
WireRelay acts as an explicit, high-efficiency endpoint relay. It is not an iptables TPROXY or NAT router; rather, it binds dedicated UDP listening sockets and maintains isolated, bounded session state tables between clients and fixed upstream servers.
Bounded Non-TPROXY UDP Forwarding Path
Fixed Backend per Listener
Each listener maps to one configured upstream endpoint, so clients cannot select arbitrary destinations. Relay clients are not authenticated; use firewall or source filtering when access must be restricted.
Payload-Opaque Forwarding
Forwards datagrams without inspecting or modifying payload bytes. Preserves cryptographic integrity, protocol signatures, and obfuscation parameters untouched.
Strict Resource Bounds
Defines global and per-source-IP session limits, a new-session rate limit, bounded queues, and idle expiration. Size these limits against the host's memory and file-descriptor budget.
Dynamic DNS Refresh
Asynchronously monitors upstream hostnames and updates backend IP endpoints without dropping active listener state when cloud VPN servers change addresses.
Transactional Reload
Validates candidate configuration with check-config and reloads through wire-relay reload. Unchanged listeners and sessions are preserved; listener additions and timeout adjustments can be applied without restarting the daemon.
Prometheus Telemetry
Exposes standard Prometheus metrics tracking packet rates, active session counts, byte counters, and error counters for production observability.
Installing & Running WireRelay
Deploy as a standalone binary or configure as a managed systemd service:
# 1. Automated installation via privileged installer script:
curl -fsSL https://raw.githubusercontent.com/wiresock/wire-relay/main/wire-relay-install.sh | sudo bash
# 2. Example configuration: /etc/wire-relay/config.toml
[service]
max_sessions = 1000
idle_timeout = "180s"
[[listeners]]
name = "wg_main"
bind = "0.0.0.0:51820"
backend = "vpn.internal.example.com:51820"
# 3. Verify configuration syntax
wire-relay check-config --config /etc/wire-relay/config.toml
# 4. Manage systemd service
sudo systemctl start wire-relay