srs/internal/proxy
winlin f42921d7b1 Claude: Add SRT proxy seams and unit tests.
Mirror the listener and backend dial seams already in place on rtc.go so
the SRT proxy is unit-testable without binding real UDP sockets:
- srsSRTProxyServer.listener: *net.UDPConn -> net.PacketConn, with a
  new listenUDP factory injected via functional option.
- SRTConnection.backendUDP: *net.UDPConn -> io.ReadWriteCloser, with a
  new dialBackendUDP factory; connectBackend uses it instead of
  building a net.UDPAddr and calling net.DialUDP directly.
- handleClientUDP / HandlePacket / handleHandshake take net.Addr
  instead of *net.UDPAddr; writes go through PacketConn.WriteTo.
- Fix a latent SA4001: v.handshake3 = &*handshake3p was no copy at
  all, so the subsequent SynCookie rewrite mutated the just-decoded
  backend packet. Replace with an explicit value copy.

Adds internal/proxy/srt_test.go covering SRTHandshakePacket marshal
roundtrip and stream-id parsing (100%), SRTConnection handshake-0,
handshake-2 full replay, and connectBackend error paths, plus
srsSRTProxyServer constructor/lifecycle and handleClientUDP routing.
Reuses fakeBackendUDP / fakePacketConn / blockingUDPListener from
rtc_test.go for consistency.

Verified with proxy-utest.sh and the full proxy-e2e suite (rtmp,
cluster, redis, transmux, srt, whip).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 20:30:22 -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_test.go Claude: Add SRT proxy seams and unit tests. 2026-05-16 20:30:22 -04:00
srt.go Claude: Add SRT proxy seams and unit tests. 2026-05-16 20:30:22 -04:00