Home > Engineering > Third Party Software > P2P building blocks > UDX

UDX

UDX is the bottom transport layer: reliable, multiplexed, congestion-controlled streams over raw UDP — with no handshake and no encryption, by design. It is pure transport for peer-to-peer use; everything above rides on it. Encryption is added by secret-stream / HyperDHT, not here. Packaged as a native addon (libudx) with a JS API.


Core API

See the README for exhaustive detail.

Create

Sockets

Streams

Utilities


Gotchas

No encryption at this layer. Confidentiality is entirely the job of the layers above (secret-stream / HyperDHT). Don’t send anything sensitive over a raw UDX stream.

framed: true makes a stream message-boundary-preserving — that is what lets protomux run over UDX without an extra length-prefix layer.

Native build. It is a native addon, so it needs the platform prebuild — relevant when targeting Bare/Pear. (Bare’s own bare-dgram no longer uses UDX: since 1.1.0 it runs on libuv UDP directly.)


Version

udx-native — latest is 1.22.1 (November 2026), the install target. The next dist-tag is a stale 1.20.6: installing @next now gets an older version. Check the npm registry before pinning. UDX has no reference page in the docs, which name libudx as one of the stack’s native foundations (How the stack fits together).

See Also