Problem
I'm using MediaMTX to proxy an RTSP stream via a WebRTC endpoint. The MediaMTX server exposes a WebRTC endpoint on port 8889
.
I need to run the MediaMTX server on a VPS which is using Caddy as a reverse proxy and a static server to serve some other files. I want to reverse proxy a certain path to port 8889
but I get application/x-unknown-filetype
errors in the frontend.
Current setup
Caddyfile
my-server.com { handle_path /relay/* { @denied not remote_ip forwarded private_ranges abort @denied reverse_proxy :8889 } }
Usage in frontend
<iframe src="https://my-server.com/relay/$cameraID"></iframe>
Potential causes/solutions
- After a little digging, I found out that this might be happening because Caddy doesn't support raw TCP traffic.
caddy-l4
might be of help. - Right now, I'm using MediaMTX to convert RTSP ➡ WebRTC and expose it to the frontend. I might try with other methods like HLS.