Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC doesn't work on firefox through NAT when webrtcAdditionalHosts contains DNS name #4017

Open
Zouizoui78 opened this issue Dec 4, 2024 · 1 comment

Comments

@Zouizoui78
Copy link

Zouizoui78 commented Dec 4, 2024

Which version are you using?

1.10

Which operating system are you using?

Linux amd64 Docker

Describe how to replicate the issue

I have the webrtcAdditionalHosts set with the local IP of my server and its DNS name like so :

webrtcAdditionalHosts: [xxx.xxx.xxx.xxx, dns.name]

Everything is working on the LAN.
It also works from the internet when NAT comes into play, but not in Firefox. I tried with Chrome and Edge and it works so it's not an issue with udp, port forwarding or something else.

After a few seconds, the following error shows up in the console in Firefox :

WebRTC: ICE failed, add a STUN server and see about:webrtc for more details

EDIT : when trying in Firefox with webrtcAdditionalHosts containing the public IP instead of the DNS name, it's working.

Server logs

Logs when trying to stream from Edge (ip addresses obfuscated) :

mediamtx  | 2024/12/04 21:34:46 INF MediaMTX v1.10.0
mediamtx  | 2024/12/04 21:34:46 INF configuration loaded from /mediamtx.yml
mediamtx  | 2024/12/04 21:34:46 INF [playback] listener opened on :9996
mediamtx  | 2024/12/04 21:34:46 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
mediamtx  | 2024/12/04 21:34:46 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
mediamtx  | 2024/12/04 21:34:56 INF [WebRTC] [session b6c13f34] created by 127.0.0.1:52170
mediamtx  | 2024/12/04 21:34:56 INF [path camera1] runOnDemand command started
mediamtx  | 2024/12/04 21:34:57 INF [RTSP] [conn 127.0.0.1:41490] opened
mediamtx  | 2024/12/04 21:34:57 INF [RTSP] [session 0429162c] created by 127.0.0.1:41490
mediamtx  | 2024/12/04 21:34:57 INF [path camera1] [recorder] recording 2 tracks (H264, Opus)
mediamtx  | 2024/12/04 21:34:57 INF [RTSP] [session 0429162c] is publishing to path 'camera1', 2 tracks (H264, Opus)
mediamtx  | 2024/12/04 21:34:58 INF [WebRTC] [session b6c13f34] peer connection established, local candidate: host/udp/dns.name/8189, remote candidate: prflx/udp/clientip/31167
mediamtx  | 2024/12/04 21:34:58 INF [WebRTC] [session b6c13f34] is reading from path 'camera1', 2 tracks (H264, Opus)

Logs when trying from Firefox :

mediamtx  | 2024/12/04 21:37:41 INF MediaMTX v1.10.0
mediamtx  | 2024/12/04 21:37:41 INF configuration loaded from /mediamtx.yml
mediamtx  | 2024/12/04 21:37:41 INF [playback] listener opened on :9996
mediamtx  | 2024/12/04 21:37:41 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
mediamtx  | 2024/12/04 21:37:41 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP)
mediamtx  | 2024/12/04 21:37:45 INF [WebRTC] [session b39b258b] created by 127.0.0.1:35866
mediamtx  | 2024/12/04 21:37:45 INF [path camera1] runOnDemand command started
mediamtx  | 2024/12/04 21:37:46 INF [RTSP] [conn 127.0.0.1:57804] opened
mediamtx  | 2024/12/04 21:37:46 INF [RTSP] [session e94c170d] created by 127.0.0.1:57804
mediamtx  | 2024/12/04 21:37:46 INF [path camera1] [recorder] recording 2 tracks (H264, Opus)
mediamtx  | 2024/12/04 21:37:46 INF [RTSP] [session e94c170d] is publishing to path 'camera1', 2 tracks (H264, Opus)
mediamtx  | 2024/12/04 21:37:56 INF [WebRTC] [session b39b258b] closed: deadline exceeded while waiting connection

Network dump

No response

@YehorFedorov
Copy link

Same issue...
Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants