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 exactly one predetermined upstream endpoint. Eliminates open-relay vulnerabilities and ensures all ingress packets travel strictly to trusted VPN servers.
Payload-Opaque Forwarding
Forwards datagrams without inspecting or modifying payload bytes. Preserves cryptographic integrity, protocol signatures, and obfuscation parameters untouched.
Strict Resource Bounds
Defines explicit per-listener maximum concurrent session limits and inactivity timeouts. Protects edge relay hosts against memory exhaustion and stale session bloat.
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
Supports atomic configuration validation (--check) and live reload via signals, allowing listener additions and timeout adjustments 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/wirerelay/wirerelay.toml
[listeners.wg_main]
listen = "0.0.0.0:51820"
backend = "vpn.internal.example.com:51820"
max_sessions = 1000
session_timeout_seconds = 180
# 3. Verify configuration syntax
wirerelay --check /etc/wirerelay/wirerelay.toml
# 4. Manage systemd service
sudo systemctl start wirerelay