4 ms·
mediasoup is a SFU that must be deployed in a reachable server, so STUN is not needed at all. You may need a TURN server if a client has a restrictive firewall
by ibc 6y ago
mediasoup is a SFU that must be deployed in a reachable server, so STUN is not needed at all. You may need a TURN server if a client has a restrictive firewall that blocks UDP. mediasoup is not a TURN server but you can deploy a TURN server (i.e. coturn) in your backend.
- orixilus 6y agoI just tried the demo - btw, best UX so far from all that I've tried. It works fine on the same wifi network, but won't connect if one of the devices is using 4G network - is this because the TURN server is not setup? Is it easy to implement that?
- ibc 6y agoThe demo is just a demo. mediasoup is a low level library (no UX into mediasoup). The online demo backend does not have any TURN server. It's obviously recommended to deploy a TURN server.
- supermatt 6y agoAre there plans to support a TCP candidate so a TURN server isn't needed at all? It feels a bit wasteful to effectively use a TURN server as a TCP->UDP proxy for a publicly accessible server.
- ibc 6y agoWe do support TCP ICE candidates for long time: https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtc... > TCP candidate so a TURN server isn't needed at all? This is not true. A router may still block TCP traffic different than TLS or traffic that does not have destinatiuon port 80 or 443. So ICE TCP candidates do not avoid the need for a TURN server in certain cases.
- supermatt 6y agoMaybe I could allocate a port to use for an additional low priority tcp candidate via configuration, or would I need to dive into the code for this? For example, I could supply the generated udp and tcp candidates in addition to a tcp:443? What are your thoughts?
- ibc 6y agoYou cannot select a specific listening port for a specific transport, because each WebRTC transport requires, at least, a different listening port in the server: https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtc... YouIf you want to listen in TLS 443 for all clients, add a TURN server into your backend. Just that.
- supermatt 6y agoIs there a reason for the restriction of one connection per port? I would have thought you would be able to use the same port for each peer source ip/port tuple? Not doubting you - but I never experienced this limitation with other client/server applications. I have an http server serving over 200k concurrent websockets on port 443, for example. I'm happy to help out with this if I can.
- ibc 6y agoMajority of RTP media server listen into a separate port for each connection. That's how RTP typically works. This is not TCP connections.
- supermatt 6y agorfc3550 states that it is per destination ip/port tuple. So you should be able to support multiple connections per local port. Is it possible this is an oversight in the current implementation? I appreciate this isn’t TCP, which is why I have just read through all relevant RFCs.