Repository navigation
Releases
v0.7.0-beta
Beta release. The pool now survives a stuck relay and a change of network.
A relay that stops accepting writes
A relay can wedge so that the write to it never returns. The obfuscation
conns serialise writes and ignore write deadlines, so one stuck write
blocked every writer on that worker: the uplink held a stolen datagram,
and the probe loop blocked mid-iteration, which silenced both the health
estimator and the zombie check. The worker sat "active", inflating the
pool while carrying nothing, until the whole pool closed.
Each writer now marks when its write started and a watchdog judges a write
in flight past a second, closing the conn to unwedge it. Measured on a
wedged relay: restarted after 1.1s, where before it never recovered.
A change of network, and waking from sleep
Every TURN allocation is bound to the source address it was made from, so
switching networks or waking a laptop kills all of them at once - but a UDP
write onto the gone path still succeeds locally, so nothing errored and
recovery waited on the 120s zombie timeout.
The pool now re-establishes on a handover, triggered by the default-route
monitor and by a sleep detector (a monotonic timer cannot see suspension,
the gap between its ticks can). Sessions rebuild off the backoff ladder,
spread by a short jitter, and no relay is cooled for it. Measured: the pool
back up in about half a second.
The handover count is reported through status and the tray.
Client-only: the exit server is unaffected and needs no update.
Install (macOS Apple Silicon)
brew update && brew upgrade romanrublev/turnrelay/turnrelay romanrublev/turnrelay/turnrelay-tray
v0.6.2-beta
Fix: VK's obfuscated captcha page passes the proof-of-work input and difficulty as the first two arguments of a trailing call, and keeps changing how many arguments follow (a fourth appeared on 2026-09-30). The parser demanded exactly three, so the captcha silently stopped being solved, credential fetches failed and the worker pool thinned out. It now reads only the two load-bearing arguments. Client-only change; the exit server is unaffected.
macOS: brew update && brew upgrade romanrublev/turnrelay/turnrelay
v0.6.1-beta
Client fix: the profile now accepts a links array (multiple VK call links) for more credentials and workers. macOS: brew upgrade romanrublev/turnrelay/turnrelay.
v0.6.0-beta
Beta release. Per-flow reordering for the UDP path.
The UDP passthrough is striped across many relay workers with different
RTTs, so datagrams of one flow arrive out of order; the app saw that as
jitter, and real-time loss probes counted reordered datagrams as loss.
The sender now stamps a per-flow sequence and the receiver reorders per
flow with a 12ms time-bounded gap release: an out-of-order datagram waits
only until the gap ahead fills or 12ms elapses, so a genuinely lost
datagram stalls just its own flow, briefly. This composes with the UDP FEC
from v0.5.0 (FEC recovers losses, reordering fixes order). Flows are keyed
by association and peer, so distinct conversations and client sessions stay
independent.
Wire change on the UDP path: the client and the exit server must both run
this version. TCP traffic is unaffected during a mixed-version window.
Install (macOS Apple Silicon)
brew update && brew upgrade romanrublev/turnrelay/turnrelay romanrublev/turnrelay/turnrelay-tray
v0.5.0-beta
Beta release. Real-time UDP loss recovery.
UDP forward error correction
The UDP passthrough (real-time datagrams: games, calls, and the kind of
loss probe speed tests run) previously rode the striped relay pipe with no
FEC and no retransmit, so it saw the full VK relay loss (measured 9-23% in
the field) while the TCP/KCP path stayed clean.
This release wraps the UDP path in the same adaptive block FEC used for the
KCP side, on both client and server, with a short (6ms) flush so a sparse
real-time flow adds only a few ms. The receiver delivers datagrams on
arrival and reconstructs lost ones from parity, so order and latency are
unchanged and only losses are recovered. An in-memory lossy-pipe test
recovers 400/400 datagrams at 5% path loss.
Wire change on the UDP path: the client and the exit server must both run
this version. TCP traffic is unaffected during a mixed-version window.
Install (macOS Apple Silicon)
brew update && brew upgrade romanrublev/turnrelay/turnrelay
v0.4.0-beta
Beta release. Transport resilience and exit-mode security.
Transport
- Adaptive block FEC over the KCP pipe: parity tracks the measured loss, so a
clean path pays no overhead while a lossy one is protected, with no KCP
reconnect. Eliminates the variable relay loss that capped throughput. - Health-based worker pool: each worker's relay RTT and loss are measured from
the probe the exit server already echoes; the supervisor retires the single
worst relay when it is a genuine outlier and re-allocates a fresh one from the
credential pool. Path-wide loss no longer triggers churn, and a per-relay
cooldown avoids landing back on a bad relay. - Telemetry:
status --jsonand the tray now show live active workers,
cumulative evictions, worst-worker loss and mean relay RTT.
Security
- Exit-mode DTLS can now be authenticated by pinning the server's certificate
fingerprint (server_fingerprintin the profile / outbound; run
turnrelay-server -cert <path>to persist a certificate and print its
SHA-256). This closes an on-path MITM against the exit and preserves the
WebRTC call-media disguise. Without a fingerprint the legacy behaviour is
kept. - The exit server bounds each DTLS handshake with a timeout, only starts a
session on a real DTLS record, and frees a failed handshake's state at once,
so a scan or spoofed source can no longer leak goroutines and buffers. turnrelay installcopies the daemon binary to a root-owned location and
points the service there, instead of running whatever user-writable path the
binary was launched from (a local root-escalation risk).
App
- The native client supports exit mode in the profile (
server_type: "exit",
password,server_fingerprint).
Install (macOS Apple Silicon)
brew tap romanrublev/turnrelay
brew upgrade romanrublev/turnrelay/turnrelay
v0.3.0-beta
Native turnrelay VPN client (CLI + daemon + tray). Prebuilt binary for macOS arm64; other platforms build from source.
v0.2.0-beta
Highlights
- Native sing-box outbound (
"type": "turnrelay"), shipped as thesingbox/module: the transport is one config block with no separate process, and thewireguardendpoint uses it viadetour. GUI clients and custom builds register it with oneRegisterOutboundcall. - Proxy-exit server mode (WireGuard now optional). A new
turnrelay-serverterminates the obfuscated TURN transport and dials destinations itself: session-authenticated with a pre-shared password, KCP+smux for TCP, framed datagrams for UDP, private/loopback destinations denied by default. The sing-box outbound gains"server_type": "exit"(a normal TCP+UDP outbound), andturnrelay-proxyis a local SOCKS5 front for any other client (V2RayN, browsers, curl). - Security hardening of the datagram read paths, VK credential-error handling (no token leakage), and the UDP CLI.
Binaries
turnrelay-udp (WireGuard bridge), turnrelay-server (exit server), turnrelay-proxy (local SOCKS5). make build produces all three.
Docs
Server setup (EN/RU), singbox/README.md, and the roadmap are updated; the sing-box in-tree question is tracked in SagerNet/sing-box#4534.
Known limitations
- Beta. Exit-mode UDP forwarding resolves DNS on a shared loop, so a slow-resolving destination can degrade UDP for other sessions on the same server; a fix is planned.
Full changelog: v0.1.0-beta...v0.2.0-beta
v0.1.0-beta
First public beta of turnrelay - tunnel UDP through WebRTC TURN relays (VK Calls and others), disguised as call media, routed by sing-box.
What's in it
- Go library: N TURN allocations as one UDP dialer, usable as a sing-box
N.Dialer. - Obfuscation modes:
srtp(DTLS-SRTP, default),wrap,dtls. - Credential providers:
vk(anonymous VK call-link join, captcha solved automatically) andstatic(any relay, e.g. self-hosted coturn). - Quota-aware credential pool (~18 allocations per credential), work-stealing uplink with no datagram loss.
turnrelay-udpCLI: a local UDP bridge that works with sing-box (or any WireGuard client) today.- Server setup script and docker interop test.
Status
Beta. Works end to end with a WireGuard endpoint under sing-box. The native sing-box outbound is the next milestone - see ROADMAP.
For research and educational use. Read SECURITY.md before relying on it.