From e257deb74404e1380d4122df0ff8a556f7be44d3 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Sun, 10 May 2026 13:30:35 -0400 Subject: [PATCH] webrtc: expose ICEServerURIs on Subsystem for WHEP Link header (issue #19) --- app/webrtc/subsystem.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/webrtc/subsystem.go b/app/webrtc/subsystem.go index 6a3e902..69bdc88 100644 --- a/app/webrtc/subsystem.go +++ b/app/webrtc/subsystem.go @@ -180,6 +180,14 @@ func (s *Subsystem) StreamCount() int { return len(s.streams) } +// ICEServerURIs returns the ICE server URI list from the core config. +// Used by the WHEP handler to emit RFC 9429 ยง4.3 Link headers so that +// browsers can discover STUN/TURN servers without a separate signalling +// round-trip. +func (s *Subsystem) ICEServerURIs() []string { + return s.coreCfg.ICEServers +} + // lookup returns the per-process WHEP stream pair for id, or nil, false. // Used by the WHEP handler. func (s *Subsystem) lookup(id string) (*processStream, bool) {