tauri-plugin-webrtc WebRTC for Tauri on Linux GitHub

Testing

The plugin is tested end to end: a real Tauri app on WebKitGTK, with the shim, talks to real browsers, SFUs, homeservers and TURN servers. The engine's own tests and CI live in qrtc.

The suites

Each harness in tests/ starts examples/e2e-app, a Tauri app built the way Tchap builds its window, and drives it with standard web APIs only. Chromium, through Playwright, is the other side unless noted.

HarnessWhat it provesNeeds
shim-e2e.mjsData channels, video and audio both ways, with the app as offerer and as answerer. --page index-csp.html repeats it under Tchap's CSP; --mdns uses mDNS candidates.Chromium
livekit-e2e.mjsThe app and Chromium join one LiveKit room, publish a tone and a marked video, and each hears and sees the other. Plain and with E2EE; --iframe runs it in a same-origin iframe, as Element Call does.livekit-server
matrix-e2e.mjsTwo users on a homeserver call each other with the real matrix-js-sdk, in both directions, including a screen-share renegotiation.Synapse (SYNAPSE_PY)
h264-e2e.mjsH.264 only, between two app instances; each decodes the other.A GStreamer H.264 encoder
turn-e2e.mjsRelay-only candidates through coturn over UDP, TCP and TLS, then a data channel.turnserver, openssl

The bundled Playwright Chromium has no H.264. For H.264 with a browser, run shim-e2e.mjs with CHROMIUM set to Google Chrome.

Running them

# The TURN harness uses qrtc's stdio_peer, from a checkout next to this one
(cd ../qrtc && cargo build --example stdio_peer)

cd tests && npm install
node matrix/build.mjs
mkdir -p ../examples/e2e-app/dist/lk
cp node_modules/livekit-client/dist/livekit-client.{umd.js,e2ee.worker.mjs} ../examples/e2e-app/dist/lk/
cargo build --release -p e2e-app
APP=../target/release/e2e-app

node shim-e2e.mjs --app $APP
node shim-e2e.mjs --app $APP --page index-csp.html
node livekit-e2e.mjs --app $APP
node livekit-e2e.mjs --app $APP --iframe
node matrix-e2e.mjs --app $APP
node h264-e2e.mjs --app $APP
node turn-e2e.mjs

On Linux the harnesses start the app under xvfb-run, so they need Xvfb but no display. Each exits non-zero when a check fails.

On macOS the same suites run against WKWebView with the shim forced over its native WebRTC: set E2E_FORCE_SHIM=1 and point CHROMIUM at Google Chrome, which has H.264. The app is launched directly. This checks the shim, the engine and browser interop, not WebKitGTK.

Testing your own app

The harnesses also drive a Tchap build that carries a small, test-only hook: pass it as --app, and add --tchap to the LiveKit and Matrix tests. The hook connects the app to the harness's WebSocket so scenarios can run inside it. Build it into test builds only.

Known flakes

The LiveKit iframe case failed once in fifteen runs: Chromium heard the app's tone about 27 dB below normal. The fourteen reruns passed, and the cause is not yet known.