talk icon indicating copy to clipboard operation
talk copied to clipboard

Using your own stun/turn server

Open platform-kit opened this issue 3 years ago • 1 comments

Hi there. Great work on this app, very elegant.

For privacy/security purposes I would like to use my own stun/turn server. What do I need to do to implement that?

It looks like there's a large list of servers in the ICE_SERVERS array at the top of script.js. Some of these contain a single url, some contain multiple urls, and some contain username/credentials data.

Assuming I've deployed my own stun/turn server which requires "username" as the username and "password" as the password, what would my ICE_SERVERS array need to look like?

Perhaps something like:

const ICE_SERVERS = [
  {
    urls: "stun:video.MYDOMAIN.com:3478",
    username: "username", 
    credential: "password",
  },
];

?

platform-kit avatar Jul 06 '22 01:07 platform-kit

Don't forget to add the Stun Server too:

const ICE_SERVERS = [
  {
    urls: "stun:YourStun"
  },
  {
    urls: "turn:YourTurn",
    username: "turnUsername", 
    credential: "turnPassword",
  },
];

I recommend only to set one Stun & Turn.

Take a look to coturn and here an example on how to setup it.

It could be improved slightly by putting this config in an .env file to not be hardcoded.

However I agree, it's a well done app, simple and very intuitive to understand, it did a great job!

miroslavpejic85 avatar Jul 06 '22 06:07 miroslavpejic85