datarhei-dragonfork-core/app/webrtc
Zac Gaetano f6d5b3378a feat(webrtc): add Echo WHEP handler for app/webrtc subsystem
Introduces the HTTP surface the browser (or OBS WebRTC clients)
target when subscribing to a process's egress:

  POST   /whep/:id              -> answer SDP + Location header
  DELETE /whep/:id/:resource    -> tear down a specific peer

The handler looks up the per-process stream pair via the Subsystem,
validates SDP offer shape, and delegates peer creation to the core
PeerFactory's CreatePeerFromSources (two-source forwarding).

WHEP routes are left unauthenticated in M2 — browsers and OBS don't
carry the Core JWT, and per-process signed-URL tokens are an M3
enhancement. Deployments should place the endpoint behind an
authenticated reverse-proxy for now.

Tests cover:
  - 404 for POSTs against unregistered streams
  - 400 for empty/invalid SDP offers once a stream is registered
  - 404 for DELETE against unknown resource ids
2026-04-17 10:03:24 -04:00
..
ffmpeg_args.go feat(app/webrtc): port allocator + FFmpeg arg builder 2026-04-17 09:52:09 -04:00
ffmpeg_args_test.go feat(app/webrtc): port allocator + FFmpeg arg builder 2026-04-17 09:52:09 -04:00
handler.go feat(webrtc): add Echo WHEP handler for app/webrtc subsystem 2026-04-17 10:03:24 -04:00
handler_test.go feat(webrtc): add Echo WHEP handler for app/webrtc subsystem 2026-04-17 10:03:24 -04:00
lifecycle.go feat(webrtc): add app/webrtc subsystem + lifecycle hooks 2026-04-17 10:02:00 -04:00
lifecycle_test.go feat(webrtc): add app/webrtc subsystem + lifecycle hooks 2026-04-17 10:02:00 -04:00
portalloc.go feat(app/webrtc): port allocator + FFmpeg arg builder 2026-04-17 09:52:09 -04:00
portalloc_test.go feat(app/webrtc): port allocator + FFmpeg arg builder 2026-04-17 09:52:09 -04:00
subsystem.go feat(webrtc): add app/webrtc subsystem + lifecycle hooks 2026-04-17 10:02:00 -04:00