PlayBridge Desktop and Stream Proxy
Establish ownership
- Treat
desktop/as the Flutter Desktop build. The standalone Dart stream proxy has been removed; production proxying is the Rust sender service andstream-proxy-rust/. - Treat
desktop/lib/receiver_server.dartas the production PlayBridge receiver adapter. Rust owns TLS/WSS, pairing, authentication, limits, and command decoding; Dart ownsPlayerController, UI, certificate/token persistence, discovery publishing, and application lifecycle. - Treat Rust sender services as the owner of Desktop's outbound discovery/cast workers, embedded Rust stream proxy, and sender-hosted browser receiver lifecycle. Dart owns UI policy, routing choices, media preparation, and session orchestration around those services.
- Keep small in-process proxy adaptations with the Desktop owner. Split out a proxy owner for API, authentication, networking, HLS rewriting, FFmpeg, Docker, or standalone release work.
- Give shared Desktop/proxy interfaces one writer while the other consumer reviews compatibility.
- Load
playbridge-extensionfor native-messaging or browser-to-Desktop bridge changes. - Load
playbridge-rust-corefor receiver runtime, Cast session/sender-services ABI, browser receiver host, bundled native library, orpackages/playbridge_cast_core_dart/changes. - Load
playbridge-protocolfor cast envelopes, pairing, authentication, or generated Dart binding changes.
Work safely
- Follow the root
AGENTS.mdand preserve unrelated Desktop working-tree edits. - Keep proxy credentials and session authorization out of logs.
- Preserve authenticated headers without exposing full stream URLs or tokens in diagnostics.
- Preserve the persisted receiver TLS identity and SPKI pin across the Rust migration. Store paired credentials as SHA-256 token digests and refresh the runtime after forgetting devices so active credentials are revoked.
- Keep platform-specific Desktop behavior compatible with macOS, Windows, and Linux where practical.
Verify
From desktop/:
flutter test
flutter analyze
When the Rust receiver, Cast/sender-services C ABI, Dart wrapper, browser receiver,
or bundled library changes, run from
the repository root before the Desktop checks:
sh cast/build-desktop.sh
cd packages/playbridge_cast_core_dart && dart analyze --fatal-infos
cd ../../desktop && flutter test test/rust_receiver_runtime_test.dart
Build the Rust proxy Docker image when container, native dependency, or packaging behavior changes. Load playbridge-stream-proxy-rust for that work.