webrtc-rs/webrtc
74.8
Strong · 14 November 2026
12.2k
lines of production code
Rust
primary language
5
measurements over time
What this system is
Features
Introduce async RtpTransceiver, RtpSender, and RtpReceiver traits
The \src/rtp\_transceiver\ module now exposes public async traits (\RtpTransceiver\, \RtpSender\, \RtpReceiver\) that manage media tracks over a peer connection. These traits provide methods to control transceiver direction, replace tracks, set parameters, and retrieve statistics, with all async operations routing through a background driver. The implementation uses \Weak\ references to \PeerConnectionRef\ to prevent memory leaks and cycles, ensuring that receivers and senders are properly cleaned up when the connection closes.
_src/rtp\transceiver · high confidence
Introduction of async PeerConnection driver and media track abstractions
This change introduces the core async driver loop for PeerConnection and the new media stream track traits (Track, TrackLocal, TrackRemote) in the src/peer\_connection and src/media\_stream modules. The driver manages the underlying network sockets, ICE, and DTLS state asynchronously, while the new track abstractions provide an async-friendly interface for handling local and remote media, including capabilities, constraints, and encoding parameters.
_src/peer\connection · high confidence
New DataChannel API with event polling and back-pressure support
The \src/data\_channel\ module introduces a new \DataChannel\ trait that replaces the previous callback-heavy design with an asynchronous polling model via the \poll()\ method. Users can now fetch events like opening, closing, and messages in a loop. The API includes methods for sending data (\send\, \send\_text\) and text, with optional blocking behavior when a send-buffer limit is configured to manage memory usage. It also exposes channel properties such as label, state, and buffered amount thresholds, allowing applications to implement flow control and monitor channel health.
_src/data\channel · high confidence
New asynchronous API for receiving remote media tracks
The \src/media\_stream/track\_remote\ module introduces the \TrackRemote\ trait and \TrackRemoteEvent\ enum, providing a new way to handle incoming media from remote peers. Instead of relying on synchronous callbacks, users can now asynchronously poll for events such as incoming RTP/RTCP packets, mute/unmute states, and track lifecycle changes (open, ending, ended) using the \poll()\ method. This change also exposes a \write\_rtcp()\ method to send feedback packets (like PLI or NACK) back to the sender, and clarifies that inbound RTCP is only delivered to the application if explicitly marked with \Attribute::DeliverToApplication\ by an interceptor.
_src/media\_stream/track\remote · high confidence
New examples for bandwidth estimation, broadcasting, and custom async runtimes
The examples directory now includes \bandwidth-estimation-from-disk\, which demonstrates switching between pre-encoded video renditions based on congestion control estimates; \broadcast\, which shows how to relay a single video stream to multiple viewers; and \custom-runtime\, which proves the library is runtime-agnostic by implementing the \Runtime\ trait over \async-executor\ and \async-io\ instead of the default Tokio or smol. A shared \common\ module provides runtime-agnostic helpers for these examples, and the main README has been updated to document all available examples.
examples · high confidence
New local track API for sending media via RTP packets or raw samples
The \src/media\_stream/track\_local\ module introduces a new interface for sending local media to remote peers. It provides the \TrackLocal\ trait with \bind\/\unbind\ lifecycle methods and an asynchronous \poll\ method to receive RTCP feedback events (such as keyframe requests) from the remote peer. Two concrete implementations are added: \TrackLocalStaticRTP\ for forwarding pre-packetized RTP data (useful for SFUs or RTP ingest), and \TrackLocalStaticSample\ for writing raw encoded media frames (VP8/H.264/Opus), which handles packetization, sequencing, and timestamping automatically. This allows applications to either pass through existing RTP streams or generate new ones from raw media samples.
_src/media\_stream/track\local · high confidence
Pluggable async runtime with deterministic mock for testing
The WebRTC stack now abstracts asynchronous operations (task spawning, timers, UDP/TCP sockets, DNS) behind a new \Runtime\ trait, allowing the library to run on different async runtimes (Tokio, smol) or custom implementations. This change introduces a \MockRuntime\ (behind the \runtime-mock\ feature) that uses a \VirtualClock\ to drive timers and an in-memory \MockUDPNetwork\ for synchronous datagram delivery, enabling deterministic, wall-clock-free end-to-end testing of timing-dependent behaviors like ICE and DTLS. Additionally, the Tokio and smol implementations now use a shared, bounded pool of single-threaded reactor threads for peer-connection drivers, replacing the previous one-thread-per-connection model to improve resource utilization and throughput.
src/runtime · high confidence
Behavioural changes
Introduction of runtime-agnostic async WebRTC API with driver-based architecture
The library now exposes a new public API surface in \src/lib.rs\ that separates protocol state from I/O using a driver-based architecture. Users interact with the \PeerConnection\ trait and \PeerConnectionBuilder\ to manage connections, while a background \PeerConnectionDriver\ handles network sockets and timeouts. The API is runtime-agnostic, supporting both Tokio (default) and smol via Cargo features, and re-exports core types like \Error\, \Result\, and event handlers from the underlying \rtc\ crate to simplify imports. This change introduces the foundational modules for peer connections, data channels, media streams, and RTP transceivers, replacing the previous structure with a more extensible and sealed trait design.
src · high confidence
New Sans-I/O transport layer for UDP, TCP, STUN, and TURN
The \src/peer\_connection/transport\ module has been replaced with a new Sans-I/O architecture that separates transport logic from the async runtime. This change introduces dedicated modules for STUN gathering (\stun\_gatherer\), TCP transport (\tcp\_transport\), and TURN relaying (\turn\_relayer\), along with a new \mod.rs\ that defines the public W3C-compliant transport objects (\SctpTransport\, \DtlsTransport\, \IceTransport\). Users benefit from more robust ICE candidate gathering, including fixes for STUN server address family matching and TURN allocation refresh caps, as well as improved TCP stream handling and GRO/GSO buffer optimizations for better performance at scale.
_src/peer\connection/transport · high confidence
New audit scripts for channel overflow policies and crypto boundaries
Added two new Python scripts to enforce critical invariants in the codebase. \check-channel-overflow-policy.py\ scans Rust source files to ensure every send operation on bounded internal channels explicitly declares an overflow handling strategy (such as awaiting, nudging, detaching, retaining, or dropping), preventing silent data loss. \check-crypto-boundary.py\ verifies that the async WebRTC crate does not directly depend on any cryptographic implementations, ensuring it only forwards provider features to the dedicated \rtc-crypto\ layer to maintain a single source of truth for crypto backends.
scripts · high confidence
Per-connection crypto provider selection and resilient bind address handling
Users can now select the cryptographic provider (e.g., \ring\ or \aws-lc-rs\) on a per-peer-connection basis via \SettingEngine\, allowing different connections in the same process to use different providers without affecting each other. Additionally, bind address resolution is now re-evaluated on every bind, meaning wildcards re-enumerate local interfaces and hostnames follow DNS changes; addresses that fail to bind are skipped with a warning rather than failing the connection, improving stability during network handovers.
(repo-wide) · high confidence
Test coverage
Added integration tests for connection lifecycle, resource cleanup, and runtime interoperability
Added a suite of integration tests in the \tests/\ directory to verify critical WebRTC behaviors. These tests confirm that unbindable network addresses are skipped without failing the connection, that closing a connection properly terminates all event streams (DataChannel and Track polls), and that PeerConnection resources are fully released after close and drop, even when transceivers are present. The suite also validates that different async runtimes can interoperate within a single process, that crypto providers (ring and aws-lc-rs) are correctly selected and integrated, and that data channel send back-pressure is correctly woken upon connection close.
tests · high confidence
Dependencies
WebRTC library v0.21.0 with pluggable async runtimes and crypto providers
The webrtc crate has been updated to version 0.21.0, introducing a pluggable async runtime architecture that allows users to choose between Tokio, smol, or a mock runtime via optional features (runtime-tokio, runtime-smol, runtime-mock). The library also supports pluggable crypto providers, defaulting to ring but allowing aws-lc-rs via the crypto-aws-lc-rs feature. This release includes numerous dependency updates (e.g., tokio 1.52.3, smol 2.0.2, bytes 1.12.0) and adds several new examples for data channels, ICE, and media handling.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 70 → 75 (+5.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 95 → 92 (-2.5)
- Architecture 87 → 99 (+11.9)
- Maturity 63 → 63 (-0.0)
- Readiness 76 → 75 (-1.3)
- Security 64 → 89 (+25.0)
- Event Sourcing 100 → 100 (+0.0)
- Performance 100 → 100 (+0.0)
Resolved (14)
- Duplicated block (10 lines × 2) (src/rtp_transceiver/mod.rs)
- Duplicated block (10 lines × 3) (src/peer_connection/mod.rs)
- Duplicated block (10–11 lines × 2) (src/rtp_transceiver/mod.rs)
- Duplicated block (5 lines × 2) (src/peer_connection/driver.rs)
- Duplicated block (9 lines × 2) (src/rtp_transceiver/rtp_receiver.rs)
- Hotspot: src/peer_connection/transport/turn_relayer.rs (src/peer_connection/transport/turn_relayer.rs)
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- Rotate the exposed credentials — git history can't be un-committed
- Secret: private-key (crates/dtls/examples/certificates/client.pem)
- Secret: private-key (crates/dtls/examples/certificates/client.pem.private_key.pem)
- Secret: private-key (crates/dtls/examples/certificates/server.pem)
- Secret: private-key (crates/dtls/examples/certificates/server.pem.private_key.pem)
- Secret: private-key (dtls/examples/certificates/README.md)
New (21)
- Duplicated block (10 lines × 2) (src/rtp_transceiver/mod.rs)
- Duplicated block (10 lines × 3) (src/peer_connection/mod.rs)
- Duplicated block (7 lines × 2) (src/peer_connection/driver.rs)
- Duplicated block (9 lines × 2) (src/rtp_transceiver/rtp_receiver.rs)
- Edited copies of one member (3 members, 24+ corresponding lines) (src/peer_connection/mod.rs)
- Edited copies of one member (3 members, 8+ corresponding lines) (src/rtp_transceiver/rtp_receiver.rs)
- Edited copy of a member (10 corresponding lines) (src/runtime/smol.rs)
- Edited copy of a member (12 corresponding lines) (src/rtp_transceiver/mod.rs)
- Edited copy of a member (14 corresponding lines) (src/data_channel/mod.rs)
- Edited copy of a member (14 corresponding lines) (src/peer_connection/mod.rs)
- Edited copy of a member (14 corresponding lines) (src/runtime/smol.rs)
- Edited copy of a member (15 corresponding lines) (src/media_stream/track_local/static_rtp.rs)
- Edited copy of a member (15 corresponding lines) (src/peer_connection/driver.rs)
- Edited copy of a member (21 corresponding lines) (src/data_channel/mod.rs)
- Edited copy of a member (23 corresponding lines) (src/rtp_transceiver/rtp_receiver.rs)
- Edited copy of a member (8 corresponding lines) (src/rtp_transceiver/rtp_sender.rs)
- Edited copy of a member (9 corresponding lines) (src/peer_connection/transport/stun_gatherer.rs)
- Edited copy of a member (9 corresponding lines) (src/rtp_transceiver/mod.rs)
- Edited copy of a member (9 corresponding lines) (src/runtime/smol.rs)
- Off-boarding risk: anonymized user #1
- …and 1 more
Changes since last survey
- 3 commits — 1 feature/other, 2 fixes
By area
- (root) — 2 commits
- src/peer_connection — 1 commit
Notable commits
- fix: fix(driver): send TURN-relayed packets in the same poll_writes pass (#946)
- fix: fix(ice): use a random transaction ID for STUN Binding requests (#954)
- change: chore(deps): bump rtc submodule to latest master (#944)
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
webrtc-rs/webrtc was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 3c4584ae984a004def73168782fa86d59f12263a — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.