This library provides a complete implementation of the WebRTC protocol suite in Rust, enabling peer-to-peer audio, video, and data channels with an asynchronous, Rust-native stack. Its architecture separates protocol logic from I/O, giving developers control over threading and scheduling while the library manages the protocol state. The stack is built to be modular, supporting data channel multiplexing over a single SCTP association, an event-driven callback interface for responding to connection changes, and an interceptor pipeline for processing media packets without altering core protocol code.
What distinguishes this library is its emphasis on extensibility and privacy-aware design. Media streams can carry multiple simulcast or SVC encodings per track, allowing receivers to select quality based on network conditions, and the interceptor framework lets applications inspect, modify, or redirect media packets mid-stream. During peer connection establishment, the library uses mDNS to replace local IP addresses with .local hostnames, preventing address leakage. Connection statistics such as packet loss, bandwidth, and round-trip time are collected in real time for monitoring and feedback, while RTCP signals inform adaptive bitrate adjustments.
The library manages the full WebRTC protocol stack, from ICE-based peer connection establishment to server-side media relay via a selective forwarding unit for multi-participant calls. Its event handling uses structured traits rather than raw callbacks, and non-blocking I/O supports many simultaneous connections. To simplify testing, the architectural decoupling of protocol logic from transport lets developers run deterministic tests using virtual time, independent of real network I/O.