Commit Graph

2 Commits

Author SHA1 Message Date
Blax Software e675531bb0 test(sfu): in-process media-forwarding integration test (rust/tests/forwarding.rs)
Closes the coverage gap the README flagged as "Next": two real str0m clients
connect to the sidecar over loopback UDP (full ICE/DTLS/SRTP + the data-channel
renegotiation the browser does), peer A sends Opus RTP, and we assert peer B
RECEIVES the forwarded media. Pure `cargo test`, ~0.8s, no browser — proves the
SFU data plane (accept offer → forward without decode) end to end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 10:53:50 +02:00
Blax Software aca88c3dbc feat: Rust SFU data plane — backend-hosted rooms, plug-and-play sidecar binary
rust/ becomes a standalone static binary (blax-webrtc-sfu, tokio-free
std-thread loop on str0m): terminates ICE/DTLS/SRTP, forwards Opus between
room peers without decoding, records per-peer Ogg/Opus (ffprobe-verified),
server-side mute/kick, stats + peer_connected/peer_left usage events, all
driven by PHP over a JSON-lines Unix control socket. Renegotiation rides the
browser data channel (str0m chat model) — signaling only carries the initial
offer/answer.

PHP side: RustMediaEngine (MediaEngine contract + room-aware API) is
plug-and-play — first use downloads the sha256-verified prebuilt binary
(BinaryManager, RoadRunner pattern) and spawns it detached, flock-guarded
(SidecarSupervisor). webrtc:install / webrtc:sidecar provided for explicit
control; config gains the webrtc.sfu block. Replaces the ext-php-rs
Str0mMediaEngine seam.

Tests: 61 PHP (incl. a real PHP<->Rust E2E that spawns the sidecar from
PHPUnit) + 7 Rust (incl. an end-to-end control-socket integration test).
build-release.sh produces the static-musl release + .sha256 (verified:
static-pie, 9.2MB, runs).

Card #1083 (rel #1051 #1060 #1064).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:29:26 +02:00