WebRTC.rs is a Rust implementation of WebRTC with async APIs, pluggable runtimes, and a Sans-I/O core inspired by Pion.
Overview
WebRTC.rs provides peer connections, media tracks, and data channels for Rust programs that need real-time communication. The main async crate sits on a Sans-I/O core and ships with Tokio and smol runtime backends; custom runtimes can be injected per connection.
Cryptography goes through a provider-neutral API with built-in ring and aws-lc-rs options, and applications may supply their own provider. Feature flags control runtime and crypto choices without forcing a single global configuration.
Event handling uses one trait-based handler with default no-ops, and a background driver manages sockets, timers, and protocol state. The project includes many runnable examples covering data channels, simulcast, ICE restart, and insertable streams.
Version 0.21.x is the recommended line while the API moves toward a stable 1.0 release. Documentation and examples are published with the crate.
Key features
- Async peer connection API
- Tokio and smol runtime backends
- Pluggable crypto providers
- Sans-I/O testable core
- Data channels and media tracks
- Runtime-agnostic custom backends
- RFC-oriented conformance focus
Use cases
- Building Rust WebRTC clients or servers
- Embedding real-time media in Rust services
- Testing WebRTC with a mock runtime