The crate family
19 crates published from the rtci workspace at 0.5.0, plus rtci-host 0.2.0 and rtci-ffi 0.1.0, each in a repository of its own.
your application (signalling, the loop) a JavaScript runtime (Deno.dlopen)
| |
| rtci-ffi 0.1.0
| |
| rtci-host 0.2.0 (sockets, timers, STUN/TURN
| | clients, ICE-TCP, mDNS, media, events)
v v
rtci 0.5.0 the engine: JSEP, ICE, DTLS, SCTP, data channels, SRTP, RTP/RTCP
| (never opens a socket, arms a timer or reads the clock)
+-- rtci-ice rtci-stun rtci-turn rtci-mdns rtci-dtls rtci-srtp
+-- rtci-sctp rtci-datachannel rtci-rtp rtci-rtcp rtci-sdp
+-- rtci-interceptor (+ -derive) rtci-media rtci-sframe
+-- rtci-shared rtci-crypto (ring | aws-lc-rs | your provider)
rtci-stream-driver 0.5.0: an optional tokio (or other runtime) driver that owns the
engine's TCP sockets, or a whole peer connection's sockets (feature peer)Engine and driver
The engine (rtci) decides and runs every protocol: which TCP candidates exist, which connections to open and when to close them, RFC 4571 and TURN framing, TLS and DTLS to TURN servers, the TURN client, STUN Binding requests, the Happy Eyeballs race, NAPTR / SRV resolution order, ICE, DTLS, SCTP and SRTP. It names listeners and connections by id and never touches a socket or a clock. A driver owns the sockets and nothing else: it binds, connects, accepts, reads, writes, closes and resolves names when the engine says so, and reports what happened. The application owns its UDP sockets, signalling and the loop (README, "Driving the Engine").
The rtci workspace
The engine is the root crate, rtci; each protocol is a crate of its own, usable alone and re-exported by rtci (rtci::ice, rtci::dtls, ...). Each crate's README lists the specifications it implements; its API page here renders that README.
| Crate | What it is (its manifest) | |
|---|---|---|
rtci | A sans-I/O WebRTC implementation: peer connections with ICE, DTLS-SRTP, SCTP data channels, RTP/RTCP and JSEP negotiation | crates.io · docs.rs |
rtci-crypto | Provider-neutral cryptography interface of a sans-I/O WebRTC stack, with ring and aws-lc-rs providers | crates.io · docs.rs |
rtci-datachannel | WebRTC data channels and the Data Channel Establishment Protocol (RFC 8831, RFC 8832), sans-I/O | crates.io · docs.rs |
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 |
rtci-ice | Sans-I/O ICE agent (RFC 8445) with trickle ICE, ICE-TCP and consent freshness, for WebRTC | crates.io · docs.rs |
rtci-interceptor | Sans-I/O RTP/RTCP interceptor pipeline for WebRTC: RTCP reports, NACK, TWCC, congestion control, pacing, FEC | crates.io · docs.rs |
rtci-interceptor-derive | Derive and attribute macros for the interceptor traits of a sans-I/O WebRTC stack | crates.io · docs.rs |
rtci-media | Media samples and container readers and writers (IVF, Ogg Opus, H.264 / H.265 Annex B) for WebRTC | crates.io · docs.rs |
rtci-mdns | Sans-I/O mDNS (RFC 6762) querier and responder, as used for WebRTC mDNS ICE candidates | crates.io · docs.rs |
rtci-rtcp | RTCP packet parsing and serialization (RFC 3550, RFC 4585, RFC 5104, RFC 3611, RFC 8888) for WebRTC | crates.io · docs.rs |
rtci-rtp | RTP packets, header extensions (RFC 3550, RFC 8285) and codec payload formats for WebRTC | crates.io · docs.rs |
rtci-sctp | Sans-I/O SCTP (RFC 9260) with partial reliability and stream reconfiguration, for WebRTC data channels | crates.io · docs.rs |
rtci-sdp | SDP parsing and serialization (RFC 8866) with the attributes WebRTC negotiation uses | crates.io · docs.rs |
rtci-sframe | Sans-I/O SFrame (RFC 9605) end-to-end media encryption | crates.io · docs.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 |
rtci-srtp | Sans-I/O SRTP and SRTCP (RFC 3711, RFC 7714 AES-GCM, RFC 9335 Cryptex) for WebRTC | crates.io · docs.rs |
rtci-stun | STUN messages, attributes and a sans-I/O client (RFC 8489), for WebRTC | crates.io · docs.rs |
rtci-turn | Sans-I/O TURN client (RFC 8656, RFC 6062 TCP allocations) for WebRTC | crates.io · docs.rs |
The reference driver
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 |
Unlike the other crates of the workspace this one does I/O, through the async runtime it is given (runtime::Runtime; tokio, smol and a virtual-time mock are built in behind features). It carries out the engine's stream commands (listen, connect, close, reset, resolve), and with the default feature peer, peer::PeerDriver drives a whole peer connection over sockets it owns, its UDP host sockets included. It also has what a server decides and the engine does not: port ranges, which local addresses get candidates, one UDP port and one passive ICE-TCP port shared by many peer connections.
rtci-host
rtci-host | 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 | crates.io · docs.rs |
rtci-host gives each Peer (one RTCPeerConnection) its UDP sockets, timers and driver task, STUN/TURN clients over UDP, TCP and TLS, ICE-TCP in both roles and mDNS, media (transceivers, packetizing, frame assembly, encoded frames, DTMF, stats and fake capture devices for tests) and a queue of W3C events for the front end. Two traits stand between the engine and the network: NetGate, the permission gate (there is no allowing default), and NetIo, the socket factory. It was extracted from the Denext-Deno fork's ext/webrtc; that fork's built-in extension and rtci-ffi are its two front ends. Source: Brainwires/rtci-host. See Using rtci-host.
rtci-ffi
rtci-ffi | rtci-host as a dynamic library for JavaScript runtimes that load WebRTC through FFI (dodo-bindgen) | crates.io · docs.rs |
The native half of WebRTC for runtimes that load it through plain FFI (Deno.dlopen), built with dodo-bindgen 2.0: one class, Engine, and buildId. Every value crosses in caller-provided buffers, so a host needs only Deno.dlopen and symbol calls. The JavaScript half, the shim that installs RTCPeerConnection and the rest of the W3C API over it, lives with the runtime that uses it. Source: Brainwires/rtci-ffi. See rtci-ffi from JavaScript and the prebuilt libraries.
Not published
rtci-video, rtci-video-interop, rtci-custom-runtime-example. The README names rtci-video, the receive-side video pipeline, as in development and not part of the 0.5.0 release; the others are example, interop and test crates (as are the examples' signalling helper, the fuzz crates and the benchmark).