Multiplexed streams over TLS/TCP
- TLS-secured client/server transport using
rustls+tokio-rustls - Protocol isolation through the
muxtls/1ALPN identifier - Multiple independent bidirectional logical streams over one TLS/TCP connection
- Bounded-memory runtime with per-frame, per-stream, and per-connection limits
- Optional protocol keepalive and inbound idle timeouts
- Optional mutual TLS and verified peer certificate access
- Stream-oriented API with async backpressure
SendStreamimplementstokio::io::AsyncWriteRecvStreamimplementstokio::io::AsyncRead
muxtls-proto: Transport-agnostic wire protocol- QUIC-style
VarInt Framedefinitions and encode/decode routines- Protocol error types (
ProtoError,ErrorCode)
- QUIC-style
muxtls: Async transport implementation- TLS over TCP endpoint/connection/stream runtime
- Stream multiplexing and bounded-memory backpressure
- Depends on
muxtls-protofor wire format
[dependencies]
muxtls = "0.3"API documentation is available on docs.rs.
muxtls uses a four-byte big-endian length prefix followed by a frame encoded
by muxtls-proto. Client-initiated stream IDs are even, server-initiated stream
IDs are odd, and each side announces IDs monotonically with OPEN_STREAM.
See the
muxtls-proto/PROTOCOL.md
document for the complete version 1 specification and the
v1.json
file for language-independent conformance vectors.
Supported frame types:
OPEN_STREAMSTREAMRESET_STREAMPINGCONNECTION_CLOSE
cargo run -p muxtls --example echo_servercargo run -p muxtls --example echo_client
The examples generate and bypass verification of a development certificate.
Use ServerConfig::from_pem_files and ClientConfig::with_native_roots (or
explicit custom roots) in deployed services.
For mutual TLS, use the client *_and_client_auth constructors and
ServerConfig::from_der_with_client_auth, then inspect the verified certificate
chain with Connection::peer_identity.