srs/internal
winlin 953b0d63ca Claude: Add WebRTC proxy seams and unit tests.
Introduce listenUDP and backendURL functional-option seams on
webRTCProxyServer and a dialBackendUDP seam on rtcConnection, mirroring
the pattern already used by rtmpProxyServer. The seams default to the
real net.ListenUDP / http URL builder / net.Dialer so production
behavior is unchanged, but unit tests can now inject fakes.

Cover webRTCProxyServer with focused tests: constructor defaults
(including the three default-backendURL branches), Close with no
listener, Run's listen error / endpoint normalization / graceful
shutdown, HandleApiForWHIP and HandleApiForWHEP CORS preflight, Pick
error, full happy-path against an httptest backend asserting SDP port
rewrite and StoreWebRTC wiring, proxyApiToBackend error paths
(backendURL error, non-2xx, malformed answer), and handleClientUDP's
non-STUN, RTP-like, short-STUN, cached-username, LB-load, LB-error,
and cached-address paths. internal/proxy package coverage rises from
~23% to 43.4%.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 19:21:34 -04:00
..
bootstrap Claude: Split lb interfaces, extract redisclient, drop race-prone globals. 2026-05-16 11:11:18 -04:00
debug Proxy: Refine logger and environment APIs. v7.0.146 (#4670) 2026-04-28 07:18:45 -04:00
env Proxy: Refine logger and environment APIs. v7.0.146 (#4670) 2026-04-28 07:18:45 -04:00
errors Proxy: Modernize internal packages on stdlib and add unit tests. v7.0.145 (#4667) 2026-04-23 07:25:48 -04:00
lb Claude: Split lb interfaces, extract redisclient, drop race-prone globals. 2026-05-16 11:11:18 -04:00
logger Proxy: Refine logger and environment APIs. v7.0.146 (#4670) 2026-04-28 07:18:45 -04:00
proxy Claude: Add WebRTC proxy seams and unit tests. 2026-05-16 19:21:34 -04:00
redisclient Claude: Split lb interfaces, extract redisclient, drop race-prone globals. 2026-05-16 11:11:18 -04:00
rtmp Claude: Split lb interfaces, extract redisclient, drop race-prone globals. 2026-05-16 11:11:18 -04:00
signal Claude: Split lb interfaces, extract redisclient, drop race-prone globals. 2026-05-16 11:11:18 -04:00
sync Proxy: Modernize internal packages on stdlib and add unit tests. v7.0.145 (#4667) 2026-04-23 07:25:48 -04:00
utils Proxy: Refine logger and environment APIs. v7.0.146 (#4670) 2026-04-28 07:18:45 -04:00
version Proxy: Refactor server APIs and expand RTMP test coverage. v7.0.147 (#4672) 2026-05-02 09:36:55 -04:00