Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MercuryWorkshop/epoxy-tls/llms.txt
Use this file to discover all available pages before exploring further.
wisp-mux is the core Rust library behind the Epoxy TLS project’s Wisp implementation. It exposes two high-level types—ClientMux and ServerMux—that handle the full Wisp handshake, stream multiplexing, flow control, and protocol-extension negotiation over any WebSocket-compatible transport. Whether you are writing a browser proxy client, a server-side gateway, or an embedded device, wisp-mux provides the building blocks to speak the Wisp protocol correctly.
What wisp-mux provides
ClientMux— connects to a Wisp server, negotiates the protocol version and extensions, and lets you open multiplexed TCP or UDP streams with a single async call.ServerMux— accepts an incoming WebSocket connection, performs the server-side handshake, and delivers new streams to your handler code viawait_for_stream.- Wisp v1 and v2 support — pass
Nonefor a plain v1 connection or supply aWispV2Handshaketo advertise extensions and negotiate v2. Automatic downgrade to v1 is detected and exposed throughwas_downgraded(). - Extension system — the
extensionsmodule ships ready-made builders for UDP (UdpProtocolExtensionBuilder), password authentication (PasswordProtocolExtensionBuilder), certificate authentication (CertAuthProtocolExtensionBuilder), and MOTD (MotdProtocolExtensionBuilder). Custom extensions can be implemented via theProtocolExtensiontrait. - Multiple WebSocket backends — opt-in Cargo features wire up
tokio-websocketsandtokio-tungstenite. Any type that implements theTransportRead/TransportWritetraits works as a transport, including theembedded-io-asyncandembedded-nal-asyncadapters forno_stdenvironments. - WASM compatibility — the
wasmfeature routesgetrandomthrough the browser’s crypto API, so the same crate compiles for both native and browser targets.
Installation
Addwisp-mux to your Cargo.toml. Choose the WebSocket backend that matches your runtime:
certificate feature is enabled by default and adds Ed25519-based certificate authentication support.
Feature flags
| Feature | What it enables |
|---|---|
certificate (default) | Ed25519 certificate authentication extension (CertAuthProtocolExtension). Pulls in ed25519, getrandom, and bitflags. |
wasm | Configures getrandom to use the browser WebCrypto API. Required for WASM targets. |
tokio-websockets | TokioWebsocketsTransport wrapper and the tokio-websockets + tokio dependencies. |
tokio-tungstenite | TokioTungsteniteTransport wrapper and the tokio-tungstenite + tokio dependencies. |
embedded-io-async | Implements embedded_io_async::Read / Write on MuxStreamAsyncRead, MuxStreamAsyncWrite, and MuxStreamAsyncRW. |
embedded-nal-async | Implements embedded_nal_async::TcpConnect on ClientMux, enabling use with no_std networking stacks. |
Relationship to epoxy-server
epoxy-server is the production Wisp gateway that ships as part of the Epoxy TLS project. It uses wisp-mux internally to handle every client connection: it constructs a ServerMux, waits for streams with wait_for_stream, and forwards traffic over native TCP sockets. If you need a reference for how to integrate wisp-mux on the server side, the epoxy-server source is a practical starting point.
Next steps
ClientMux
Open multiplexed TCP and UDP streams from a Wisp client.
ServerMux
Accept and handle incoming Wisp streams on the server side.