Home > Engineering > Third Party Software > P2P building blocks > blind-relay
blind-relay
blind-relay is the TURN-like fallback for peer connections that cannot be established directly — when hole-punching fails (e.g. a randomizing NAT). A relay host accepts pairing requests from two peers and forwards UDX stream messages between them over protomux channels. It carries live peer traffic; it does not store or pin data. Because the relayed bytes are the peers’ already-encrypted UDX stream, the relay is “blind” to content. Not to be confused with dht-relay — that bridges the DHT protocol over TCP/WebSocket, a different job.
How it works
See the README for specifics.
A relay host accepts pair requests; two peers that present matching pairing tokens get their UDX stream messages forwarded between them (TURN-style). unpair tears it down.
The README documents the wire protocol (the pair / unpair message fields), not a JS Server/Client API. The integration surface is now documented elsewhere: relayThrough on HyperDHT connect / createServer and on Hyperswarm — HyperDHT uses blind-relay internally — and, since Pear 3.4.0, pear blind-relay start and --relay <key>. Relaying happens only when a relay is configured this way.
Gotchas
The use case is now named upstream. The docs: “A randomizing NAT … assigns an unpredictable external port per connection … A blind relay is the fallback.” The README still frames it only as “similar to TURN”.
“Blind” is now stated in the docs: the relay “moves bytes it cannot read”, because the relayed stream is end-to-end encrypted. The README still does not say it. (See the security model.)
It relays streams, it does not store data — distinct from blind-peering / seeders (availability) and from dht-relay (DHT bridging).
Version
blind-relay@1 (1.6.1, May 2026). Package name matches the repo — no trap. Check the npm registry before pinning.
See Also
- Docs: relay connections through a blind relay
- Repo: github.com/holepunchto/blind-relay (README = the authoritative reference; documents the wire protocol, not a JS API)
- npm:
blind-relay