Install & download
rtci 0.5.0, rtci-host 0.2.0 and rtci-ffi 0.1.0, as released on crates.io and GitHub.
Requirements
- Rust: the rtci crates use edition 2024; the minimum supported Rust version is 1.89 (
rust-versionin the manifests, checked by CI's MSRV job). rtci-host and rtci-ffi use edition 2024 and declare norust-version. - Platforms: rtci's CI builds and tests the workspace on Linux, macOS and Windows (cargo.yml). The real-network test environment and the browser interop run on Linux only (they need network namespaces). rtci-ffi is prebuilt for Linux x64 and arm64, macOS arm64 and x64, and Windows x64.
- C toolchain: none for the default
crypto-ringprovider.crypto-aws-lc-rspulls in the aws-lc-sys C toolchain, and so do rtci-host and rtci-ffi, which build rtci with it.
rtci, the engine
cargo add [email protected]rtci 0.5.0: the first release of the 0.5 line. The audit's last open MUST and SHOULD rows are closed, fifty-two defaults change (each with the setting that gives the 0.4 form where there is one), and two additions break exhaustive code: RTCCertificate gains a public origin field, and RTCLocalCandidatesNeededReason gains RolledBack. Moving from 0.4 is an edit of the version requirement (rtci = "0.5"), not a cargo update. See What's new in 0.5.0 and the full changelog.
Or in Cargo.toml, with the provider chosen (from the README):
# Default: the ring provider, no C toolchain required.
rtci = "0.5"
# aws-lc-rs instead (pulls in the aws-lc-sys C toolchain).
rtci = { version = "0.5", default-features = false, features = ["crypto-aws-lc-rs"] }There is no process-global provider to install: the provider is selected per peer connection through SettingEngine::set_crypto_provider, so two peer connections in one process may use different ones. See DTLS, SRTP and crypto providers.
| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | Default. The ring crypto provider, no C toolchain required. Additive with crypto-aws-lc-rs: with both on, ring is preferred.enables crypto/crypto-ring, dtls/crypto-ring, rustls/ring, rcgen/ring, ice/crypto-ring, stun/crypto-ring, srtp/crypto-ring, turn/crypto-ring, sframe/crypto-ring |
openssl | An OpenSSL AES-CTR cipher for SRTP.enables srtp/openssl | |
vendored-openssl | As openssl, with OpenSSL built from source.enables srtp/vendored-openssl | |
pem | Changes nothing: PEM certificate import and export is always built, and the feature is kept so that dependents that enable it still build.enables dtls/pem | |
turn-tls-webpki-roots | The Mozilla root certificates (webpki-roots, CDLA-Permissive-2.0) for the engine's TURN-over-TLS connections; without it the application gives roots or a verifier (with_turn_tls).enables dep:webpki-roots | |
chrome-defaults | Makes BehaviourProfile::default() (and with it every SettingEngine, MediaEngine and DefaultInterceptorOptions default) BehaviourProfile::Chrome: libwebrtc's defaults where they differ from the RFCs' (docs/behaviour-profiles.md). Cargo unifies features: one crate of a build that turns this on changes the defaults of every user of rtci in that build. Prefer SettingEngineBuilder::with_behaviour_profile. | |
performance-defaults | BehaviourProfile::Performance as the default profile (docs/behaviour-profiles.md). With chrome-defaults also on, Chrome is the default and the build warns. | |
ecdsa-rfc6979 | RFC 6979 deterministic ECDSA for the certificate key (RFC 8446 appendix C.3): RustCrypto's p256 / p384, selected by SettingEngineBuilder::with_deterministic_ecdsa and the StrictRfc profile, which needs it.enables crypto/ecdsa-rfc6979 | |
crypto-aws-lc-rs | The aws-lc-rs crypto provider (pulls in the aws-lc-sys C toolchain). Use it with default-features = false to leave ring out.enables crypto/crypto-aws-lc-rs, dtls/crypto-aws-lc-rs, rustls/aws-lc-rs, rcgen/aws_lc_rs, ice/crypto-aws-lc-rs, stun/crypto-aws-lc-rs, srtp/crypto-aws-lc-rs, turn/crypto-aws-lc-rs, sframe/crypto-aws-lc-rs |
docs.rs builds rtci with crypto-ring, crypto-aws-lc-rs, pem, turn-tls-webpki-roots.
The protocol crates
Each protocol is a crate of its own, usable alone and re-exported by rtci (rtci::ice, rtci::dtls, ...): an application of the peer connection needs only rtci. All are version 0.5.0, MSRV 1.89, MIT OR Apache-2.0.
rtci-crypto
Provider-neutral cryptography interface of a sans-I/O WebRTC stack, with ring and aws-lc-rs providers crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables dep:ring, dep:aes, dep:ctr, dep:ccm, dep:md-5, dep:hmac, dep:sha1, dep:sha2 |
crypto-aws-lc-rs | enables dep:aws-lc-rs, dep:aes, dep:ctr, dep:ccm, dep:md-5, dep:hmac, dep:sha1 | |
test-support | ||
ecdsa-rfc6979 | RFC 6979 deterministic ECDSA (P-256 / SHA-256, P-384 / SHA-384) for a signing key that exports its PKCS#8 form: RFC 8446 appendix C.3 (rfc6979::deterministic_ecdsa). RustCrypto's p256 and p384, default features off. Off by default.enables dep:p256, dep:p384 | |
openssl | Kept by the Brainwires fork for rtci-srtp's openssl feature: an OpenSSL AES-CTR stream cipher (openssl_aes_ctr). See FORK.md.enables dep:openssl | |
vendored-openssl | enables openssl, openssl/vendored |
rtci-datachannel
WebRTC data channels and the Data Channel Establishment Protocol (RFC 8831, RFC 8832), sans-I/O crates.io · docs.rs · API
cargo add [email protected]rtci-dtls
Sans-I/O DTLS 1.2 and 1.3 (RFC 6347, RFC 9147) with DTLS-SRTP key export, for WebRTC crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring, rustls/ring, rcgen/ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs, rustls/aws-lc-rs, rcgen/aws_lc_rs | |
pem | Kept by the Brainwires fork as a no-op: PEM support is now always built (upstream removed the feature name, which would break dependents that still enable it). |
rtci-ice
Sans-I/O ICE agent (RFC 8445) with trickle ICE, ICE-TCP and consent freshness, for WebRTC crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring, stun/crypto-ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs, stun/crypto-aws-lc-rs |
rtci-interceptor
Sans-I/O RTP/RTCP interceptor pipeline for WebRTC: RTCP reports, NACK, TWCC, congestion control, pacing, FEC crates.io · docs.rs · API
cargo add [email protected]rtci-interceptor-derive
Derive and attribute macros for the interceptor traits of a sans-I/O WebRTC stack crates.io · docs.rs · API
cargo add [email protected]rtci-media
Media samples and container readers and writers (IVF, Ogg Opus, H.264 / H.265 Annex B) for WebRTC crates.io · docs.rs · API
cargo add [email protected]rtci-mdns
Sans-I/O mDNS (RFC 6762) querier and responder, as used for WebRTC mDNS ICE candidates crates.io · docs.rs · API
cargo add [email protected]rtci-rtcp
RTCP packet parsing and serialization (RFC 3550, RFC 4585, RFC 5104, RFC 3611, RFC 8888) for WebRTC crates.io · docs.rs · API
cargo add [email protected]rtci-rtp
RTP packets, header extensions (RFC 3550, RFC 8285) and codec payload formats for WebRTC crates.io · docs.rs · API
cargo add [email protected]rtci-sctp
Sans-I/O SCTP (RFC 9260) with partial reliability and stream reconfiguration, for WebRTC data channels crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
bench | Exposes the internal fuzzing module (marshal/unmarshal shims) for benchmarks and micro-benchmark harnesses without requiring the --cfg fuzzing build flag used by cargo-fuzz. |
rtci-sdp
SDP parsing and serialization (RFC 8866) with the attributes WebRTC negotiation uses crates.io · docs.rs · API
cargo add [email protected]rtci-sframe
Sans-I/O SFrame (RFC 9605) end-to-end media encryption crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs |
rtci-shared
Shared types of a sans-I/O WebRTC stack: marshalling traits, transport context, replay detection, the stream transport interface crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
ifaces | yes | |
marshal | yes | |
replay | yes |
rtci-srtp
Sans-I/O SRTP and SRTCP (RFC 3711, RFC 7714 AES-GCM, RFC 9335 Cryptex) for WebRTC crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs | |
openssl | Kept by the Brainwires fork (upstream removed them): AES-CM keystream from OpenSSL.enables crypto/openssl | |
vendored-openssl | enables crypto/vendored-openssl |
rtci-stun
STUN messages, attributes and a sans-I/O client (RFC 8489), for WebRTC crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs | |
bench |
rtci-turn
Sans-I/O TURN client (RFC 8656, RFC 6062 TCP allocations) for WebRTC crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
crypto-ring | yes | enables crypto/crypto-ring, stun/crypto-ring |
crypto-aws-lc-rs | enables crypto/crypto-aws-lc-rs, stun/crypto-aws-lc-rs | |
metrics | A no-op kept for compatibility: no code is gated by it (removing the name would break dependents that enable it). |
rtci-stream-driver
A socket driver for a sans-I/O WebRTC engine (ICE-TCP, TURN over TCP and TLS, whole peer connections) on an async runtime of your choice crates.io · docs.rs · API
cargo add [email protected]| Feature | Default | What it does |
|---|---|---|
dns-records | SRV and NAPTR lookups for StreamCommand::ResolveRecords (RFC 5928, RFC 8489 section 8) and AAAA / A answered separately (StreamEvent::ResolvedFamily, RFC 8305 section 3), with hickory-resolver (MIT OR Apache-2.0). Without it records are answered as none and both families together, through the system resolver. hickory 0.26.2 or later: 0.25 carries RUSTSEC-2026-0491 (memory amplification from a response's record counts, reachable from any name server the client asks) and DNSSEC advisories (not compiled in: no dnssec-* feature). They are lookups of the tokio runtime (TokioRuntime::resolve_family / resolve_records), so the feature turns runtime-tokio on.enables runtime-tokio, dep:hickory-resolver | |
peer | yes | enables dep:rtci, dep:bytes |
runtime-tokio | yes | Built-in runtime types (runtime::TokioRuntime). Features only decide which types exist, never what the driver uses: a driver runs on the Arc<dyn Runtime> it is given. With none the crate builds without any async runtime, for an application's own (custom-runtime).enables dep:tokio |
runtime-smol | enables dep:smol | |
runtime-mock | MockRuntime: a virtual clock and an in-memory network, for tests on virtual time.enables dep:async-task |
Not published: rtci-video, rtci-video-interop, rtci-custom-runtime-example (the video pipeline, in development, and example and test crates).
rtci-host
cargo add [email protected]The host I/O around the sans-I/O rtci WebRTC engine: sockets, timers, STUN/TURN clients, ICE-TCP, mDNS and media, behind a permission gate and a socket factory. It depends on rtci = "0.4" with default features off and crypto-aws-lc-rs on (its manifest): rtci-host 0.2.0 and rtci-ffi 0.1.0 build against rtci 0.4, not 0.5.0, so an application that uses rtci-host gets rtci 0.4.x for it (a direct dependency on rtci 0.5.0 as well would build both). The engine is single-threaded: run it on a current-thread tokio runtime or inside a tokio::task::LocalSet. See Using rtci-host.
rtci-ffi: prebuilt libraries
rtci-ffi is a dynamic library (cdylib) for JavaScript runtimes that load WebRTC through FFI. Its v0.1.0 GitHub release attaches the library for each target with a SHA-256 checksum, the generated TypeScript bindings (rtci_ffi.ts, rust_type.ts) and a combined SHA256SUMS. The checksums below are copied from that SHA256SUMS.
| Target | File | SHA-256 |
|---|---|---|
aarch64-apple-darwin | rtci_ffi.aarch64-apple-darwin.dylib | 49acc3282de17be14ad061982165e04115fb8a31e56712c81d8daace6cce2ff2 |
aarch64-unknown-linux-gnu | rtci_ffi.aarch64-unknown-linux-gnu.so | ee25d6def957c011be5f004f16f47ff825930fe9235cfa76628b440e0e4d643f |
x86_64-apple-darwin | rtci_ffi.x86_64-apple-darwin.dylib | 1aef3b81ad6d04a898f571ae52016b6192060c5302b583018499ecda42e32278 |
x86_64-pc-windows-msvc | rtci_ffi.x86_64-pc-windows-msvc.dll | 97c134ef0e649113eb30abf4404c5bc5cc603d3e976cea87f0948da70343eea1 |
x86_64-unknown-linux-gnu | rtci_ffi.x86_64-unknown-linux-gnu.so | a98906b317c4d500726457d0c69cab9a13341a4581707b504f1e2aa241a6063f |
| bindings | rtci_ffi.ts | 4a35a1e96eb5d5d65cbdc227e89fbb82ebf9f1b1e93bcecfe97a3f127017632e |
| bindings | rust_type.ts | 3390361cef33d6484bba1d08bb23429bd819eba1b67a122882badce3a74c9a8a |
Put the library beside the bindings it came with. The JavaScript shim loads rtci_ffi.<target>.<ext> from there and refuses it unless its bytes match the checksum and buildId() is rtci-ffi/0.1.0. To check a download by hand against the release's list:
sha256sum -c SHA256SUMS --ignore-missing # Linux
shasum -a 256 -c SHA256SUMS --ignore-missing # macOSTo build the library and the bindings from source instead, with dodo-bindgen-cli 2.0.0 installed, from a checkout of the tag:
dodo-bindgen -o bindings/rtci_ffi.ts # release; -d for a debug build
deno fmt bindings/rtci_ffi.ts bindings/rust_type.tsThe library needs panic = "unwind" (the crate's profiles set it; it refuses to build under abort). The crate is also on crates.io (rtci-ffi). See rtci-ffi from JavaScript.
Licence
rtci, every rtci-* crate, rtci-host and rtci-ffi are licensed under either of the MIT licence or the Apache License, Version 2.0, at your option (LICENSE-MIT, LICENSE-APACHE). rtci descends from webrtc-rs rtc; upstream's licence and copyright notices are retained. The optional turn-tls-webpki-roots feature adds the Mozilla root certificates, which are CDLA-Permissive-2.0.