srs/internal/proxy
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
..
api.go Codex: Remove global proxy load balancer. 2026-05-10 21:00:17 -04:00
http.go Codex: Remove global proxy load balancer. 2026-05-10 21:00:17 -04:00
rtc_test.go Claude: Add WebRTC proxy seams and unit tests. 2026-05-16 19:21:34 -04:00
rtc.go Claude: Add WebRTC proxy seams and unit tests. 2026-05-16 19:21:34 -04:00
rtmp_test.go Claude: Add RTMP proxy seams and unit tests. 2026-05-16 16:54:11 -04:00
rtmp.go Claude: Add RTMP proxy seams and unit tests. 2026-05-16 16:54:11 -04:00
srt.go Codex: Remove global proxy load balancer. 2026-05-10 21:00:17 -04:00