ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.16k stars 618 forks source link

Support multiple turn/stun servers on SDKs #6097

Open petarb1988 opened 5 months ago

petarb1988 commented 5 months ago

The app I'm working on has its own STUN (1) and TURN (4) servers and our client wants us to use them (by the way, does Antmedia offer some STUN/TURN servers). We are trying to use antmedia for audio and video calls on our mobile apps. I am looking through the docs and apparently for versions above 2.4.4 (ours is 2.8.2, Enterprise) this needs to be done on our backend server: https://antmedia.io/docs/guides/configuration-and-testing/configuring-stun-addresses/#configuring-for-ant-media-244-and-later-versions But from what I can read you can only set one STUN or TURN server there? Is there a way I can add all 5 of our servers (1 STUN, 4 TURN)? Do STUN/TURN servers need to be set up in the android/ios apps as well, or not since I'm guessing it's all routed through our backend server?

As you can probably tell I'm not well versed in this so please have patience if I have made any glaring errors in trying to explain our situation. Thanks :)

burak-58 commented 4 months ago

Thank you @petarb1988, AMS and SDK accept only one URI now as a STUN or TURN. Let me add this to backlog. We may consider making them later. If it is important or urgent please let me know.

petarb1988 commented 4 months ago

Thank you @petarb1988, AMS and SDK accept only one URI now as a STUN or TURN. Let me add this to backlog. We may consider making them later. If it is important or urgent please let me know.

Well, it's certainly important for our client but I don't know how much work it would take on your end. Can you perhaps tell me which one of our servers would be best to use: "turn:a.relay.metered.ca:80", "turn:a.relay.metered.ca:80?transport=tcp", "turn:a.relay.metered.ca:443", "turn:a.relay.metered.ca:443?transport=tcp"?

Thanks for the reply.

mekya commented 3 months ago

Hi @petarb1988,

We've missed your question. Sorry for that. Let me answer your question as far as I know.

All of them seems to be the same service. I mean all of team provide a similar experience for you. There are just port and protocol differences. I think they are different because they don't want to be blocked in some enterprise networks. They just use default http(80) and https(443) ports which are generally open. They also provide options for tcp, because some enterprise networks block udp packets.

So you can just prefer the one that fits your networks security rules.

Cheers