deepch / RTSPtoWebRTC

RTSP to WebRTC use Pion WebRTC
MIT License
1.55k stars 413 forks source link

WebRTC: ICE failed, add a TURN server and see about:webrtc for more details #109

Open crstian19 opened 3 years ago

crstian19 commented 3 years ago

Hi, I made Dockerfile for this app and i run it in my server with traefik as reverse proxy. In LAN it works perfectly but when I try to run it in a public IP like VPS Server i've got this error:

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

Looking for information I think that I need a to expose STUN ports.

https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/ swappy-20210628_110339

rupadana commented 2 years ago

got same error

dbl0null commented 2 years ago

Common way to deal with this kind of problems is to set up your own dedicated TURN server.

You can try COTURN: https://gabrieltanner.org/blog/turn-server

Personally I prefer to stick to Golang stack and use Pion's excellent TURN implementation: https://github.com/pion/turn/blob/master/examples/turn-server/simple/main.go

You'll need to add you new TURN to PeerConnection config on client side: https://github.com/deepch/RTSPtoWebRTC/blob/master/web/static/js/app.js#L6

kumarbhupi commented 10 months ago

Hi, I was wondering if I need to add the TURN credentials in both client and server side? And how can I add it on server side?