webrtc
An async-friendly, pure-Rust implementation of the full WebRTC stack for real-time peer-to-peer communication.
Repository Health
Technical Analysis
webrtc is a pure-Rust implementation of the WebRTC API, letting Rust applications establish real-time peer-to-peer connections for data channels, audio, and video without depending on the C++ libwebrtc. It ports the layered WebRTC protocol stack—ICE, DTLS, SCTP, SRTP, RTP/RTCP, and the peer-connection API—into idiomatic, async-friendly Rust crates.
Built to run on async runtimes (tokio by default, with smol support), webrtc powers servers and clients that need low-latency, NAT-traversing communication: SFUs, game networking, browser-to-native links, and IoT streaming. It is the flagship crate of the webrtc-rs project, which maintains the underlying protocol crates as a coherent, well-tested ecosystem.
What You Get
- A high-level RTCPeerConnection API mirroring the browser WebRTC model
- Data channels for reliable and unreliable peer-to-peer messaging
- Media streaming with RTP/RTCP and SRTP encryption for audio and video tracks
- A complete protocol stack (ICE, DTLS, SCTP, SRTP) implemented in pure Rust with tokio and smol runtime support
Common Use Cases
- Building Selective Forwarding Units (SFUs) and media servers in Rust
- Adding low-latency peer-to-peer data channels to games and collaborative apps
- Bridging browsers and native Rust services over WebRTC
- Streaming audio/video from IoT or embedded devices with NAT traversal
Under The Hood
Architecture The top-level webrtc crate provides the async, runtime-driven API and delegates the sans-I/O protocol logic to an internal rtc crate (referenced as a path dependency). Its src/ splits cleanly along WebRTC’s object model—peer_connection, data_channel, media_stream, rtp_transceiver, and a runtime abstraction—so the public surface mirrors the browser API while the transport, ICE, DTLS, SCTP, and SRTP concerns live below. The runtime layer lets the same protocol core run on tokio or smol.
Tech Stack It is a Rust crate on edition 2024 depending on bytes, futures, async-trait, and log, with optional tokio (plus quinn-udp) or smol runtimes selected by feature flags. The workspace bundles the rtc protocol crates and a large examples/ and tests/ tree; codecov integration is configured.
Code Quality The project is mature and very actively developed (roughly 20+ commits/month, 169 contributors), with CI, dependency auditing (deps.rs), and code coverage badges. The dozens of runnable examples double as integration tests and documentation, and the sans-I/O split makes the protocol logic independently testable from the async plumbing.
API Design The API deliberately follows the W3C WebRTC model (RTCPeerConnection, data channels, SDP offer/answer), so web developers find it familiar, but WebRTC itself is inherently complex—signaling, ICE candidates, and media negotiation impose a steep learning curve regardless of language. The extensive examples substantially soften the onboarding cost.
Used by 3 apps in this directory
Bramble
Password Manager · Security · Authentication
Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.
LocalSend
Networking
An open-source, cross-platform AirDrop alternative that sends files and messages device-to-device over your local network with no internet, no account, and no cloud server involved.
Vibe Kanban
AI Agents · AI Code Assistants · Project Management
A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.