qrtc quantum realtime communication GitHub

qrtc

A pure Rust WebRTC engine with hybrid post-quantum key agreement. qrtc implements the network side of a peer connection behind two traits, so an application or browser can expose it as the W3C RTCPeerConnection API.

Pure RustNo libwebrtc, no GStreamer, no system packages. With turn-tls-rustcrypto the build compiles no C.
Post-quantumDTLS 1.3 and TURN over TLS with X25519MLKEM768, interoperable with Chromium and OpenSSL 3.5.
Real stacksTested against Chromium, LiveKit with E2EE, matrix-js-sdk calls and coturn.
Two consumerstauri-plugin-webrtc for WebKitGTK apps, and formal-web as a native browser engine.

What it covers

AreaCoverage
JSEPOffers, answers, renegotiation, rollback and perfect negotiation, ICE restart, setCodecPreferences
ICEHost candidates as mDNS .local names (answered and resolved), STUN, TURN over UDP, TCP and TLS, relay-only policy
DTLSDTLS 1.2, or DTLS 1.3 with post-quantum key exchange groups
Data channelsReliable and unreliable, ordered and unordered, negotiated ids, buffered-amount events
AudioOpus with in-band FEC, AEC3 echo cancellation, noise suppression and AGC, adaptive jitter buffer, one playout clock, DTMF (RFC 4733)
VideoVP8 and H.264 transport, keyframe requests, bandwidth estimation; the consumer encodes and decodes
Encoded transformsHooks for RTCRtpScriptTransform, used for LiveKit end-to-end encryption
StatsPeer connection, transport (DTLS state, tlsGroup), candidate pairs, local and remote candidates

Quick start

[dependencies]
qrtc = { git = "https://github.com/crabnebula-dev/qrtc", branch = "main" }
use qrtc::{native::NativeEngine, PeerEngine, RtcConfiguration};
use std::sync::Arc;

let engine = NativeEngine::new()?;
let peer = engine.create_peer(
    &RtcConfiguration::default(),
    Arc::new(|event| println!("{event:?}")),
)?;
let offer = peer.create_offer()?;
peer.set_local_description(&offer)?;

Every method blocks. On an async runtime, call them from a blocking pool. Events arrive in order per peer connection, on engine threads. Using the API walks through a whole connection.

Where to go next