Broadcast Fixes // StreamRelay Lab
MediaMTX WebRTC WHEP UDP :8189 & Reverse Proxy Hardening
Separating HTTPS WHEP signaling (port 443 -> 8889) from direct UDP media multiplexing (port 8189) unlocks reliable 250ms WebRTC playback across browsers.
Measured MediaMTX & FFmpeg Telemetry
Browsers reject insecure HTTP WHEP endpoints on public domains. Terminating TLS on Caddy/Nginx for the /whep POST handshake while leaving MediaMTX’s UDP :8189 socket directly reachable gives clean encrypted media.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| Signaling Endpoint | HTTPS :443 -> :8889 | Required by browser WebRTC security context |
| Media Multiplex Socket | UDP :8189 (Direct) | Single port handles all WebRTC viewers |
| Typical Glass-to-Glass | 180 - 350 ms | Ideal for interactive town halls & auctions |
Step-by-Step Triage & Config Remediation
- Open firewall ports: Allow 443/tcp, 8889/tcp (if direct), 8189/udp, 1935/tcp, and 8890/udp.
- Proxy WHEP signaling via Caddy: Forward /live/*/whep to 127.0.0.1:8889 with Access-Control-Allow-Origin headers.
- Test ICE connectivity: Confirm browser chrome://webrtc-internals shows active nominated candidate pair on UDP 8189.
# UFW rules for MediaMTX multi-protocol relay: ufw allow 1935/tcp # RTMP Ingest ufw allow 8890/udp # SRT Ingest/Relay ufw allow 8189/udp # WebRTC ICE Mux ufw allow 443/tcp # HTTPS LL-HLS + WHEP Signaling
Diagnostic FAQ
Why do corporate VPN viewers still fail on UDP 8189?
Strict enterprise firewalls that block all outbound UDP require a TURN/TLS relay on TCP 443 or automatic player fallback to LL-HLS.
Does WebRTC WHEP support ABR ladders?
WHEP delivers a single selected video track per peer; use LL-HLS when viewers need automatic ABR resolution switching.