muxtls 0.5.0

Multiplexed streams over TLS/TCP
Documentation
# muxtls

`muxtls` multiplexes bidirectional streams over a single TLS/TCP connection
using Tokio and rustls. Streams have independent send and receive directions,
with flow control and buffer limits at both stream and connection level.

```toml
[dependencies]
muxtls = "0.5"
```

Create a client or server with `Endpoint`. Use `Connection::open_bi` to open
a stream and `Connection::accept_bi` to accept one. Keep a connection handle
alive while using its streams. Each direction supports either chunk operations
or Tokio's `AsyncRead` and `AsyncWrite` traits. Use `finish` or
`AsyncWriteExt::shutdown` to finish sending. See the [API documentation](https://docs.rs/muxtls).

## Echo example

Run the server and client in separate terminals:

```console
cargo run -p muxtls --example echo_server
cargo run -p muxtls --example echo_client
```

The examples use a self-signed localhost certificate and disable client-side
certificate verification for this demonstration. For deployed services, load
the server certificate and key with `ServerConfig::from_pem_files`. Configure
clients with native roots, explicit custom roots, or the optional
`platform-verifier` feature for platform certificate verification.

For mutual TLS, configure trusted client roots with
`ServerConfig::from_der_with_client_auth` and supply a client identity using
a `ClientConfig` constructor ending in `_and_client_auth`.
`Connection::peer_identity` exposes the certificate chain from the handshake.

## Protocol

Peers negotiate `muxtls/1` through TLS ALPN. The `muxtls-proto` crate provides
the transport-independent codec. The [wire specification](https://github.com/foctal/muxtls/blob/main/muxtls-proto/PROTOCOL.md)
defines framing and stream lifecycle. See also the [flow-control rules](https://github.com/foctal/muxtls/blob/main/muxtls-proto/FLOW_CONTROL.md)
and [conformance vectors](https://github.com/foctal/muxtls/blob/main/muxtls-proto/test-vectors/v1.json).

## License

Licensed under either the [MIT license](https://github.com/foctal/muxtls/blob/main/LICENSE-MIT) or the [Apache License, Version 2.0](https://github.com/foctal/muxtls/blob/main/LICENSE-APACHE), at your option.