A Rust WebRTC server that captures video and audio from your browser's camera/microphone and streams it back in real-time. Demonstrates bidirectional WebRTC media streaming with a clean Rust backend.
- Real-time video/audio capture from browser
- WebRTC peer connection with automatic SDP exchange
- VP8 video codec with RTCP feedback (PLI)
- Opus audio codec
- Embedded web client served from the Rust binary
- Async architecture using Tokio
-
Install Rust
-
Run the server:
cargo run --release-
Open http://localhost:8080 in your browser
-
Allow camera and microphone access when prompted
-
Your video stream will appear after the WebRTC connection is established
Browser Rust Server
| |
|-- getUserMedia() --------------->|
| |
|<-- SDP Offer ------------------->|
| |
|--- RTP Video/Audio ------------->|
| |
|<-- RTP Video/Audio (loopback) ---|
The server:
- Serves the HTML client at
/ - Handles SDP offer/answer exchange at
/local - Receives media tracks from the browser
- Loops them back to demonstrate bidirectional streaming
- webrtc-rs - Pure Rust WebRTC implementation
- hyper - HTTP server for signaling
- tokio - Async runtime
MIT