Adding STUN server to Multiparty Chatroom

98 views
Skip to first unread message

William Hunter

unread,
Mar 10, 2017, 6:14:19 PM3/10/17
to EasyRTC

I am working with the Multiparty Chatroom that I have extracted from the demos. I have obtained a signed SSL certificate and all is working well. I would like to add a STUN server to the project. I found an earlier post (2013) describing how to supply a TURN server with entries in config.js. In this post there is the reference to: {url: "turn:id@ipaddress", "credential":"password"}. If these same credentials are required for a STUN server, what do they reference to?


This is my first effort with easyRTC, and I don’t see the config.js line referred to in the post. Would you please detail the additions that need to be made, as well as were to insert them in config.js.


Regards

Eric Davies

unread,
Mar 10, 2017, 6:27:10 PM3/10/17
to EasyRTC
the ice for a stun server entry just looks like 
   { url: "stun:some.host.name.or.ipaddress[:optionalPort]}

ie, here are a few we use with the demo site

    1. "stun:stun.sipgate.net"
    2. "stun:217.10.68.152"
    3. "stun:stun.sipgate.net:10000"  
    4. Defining ice server entries is covered in https://easyrtc.com/docs/easyrtc_server_ice.php
    5. Note that the current practice is to use urls instead of url (just updated that entry), and the code changes the above document references go into the server_example.js file.


William Hunter

unread,
Mar 11, 2017, 11:59:34 AM3/11/17
to EasyRTC

Thank you for your response. I have read the info available at the link in the above post. I have appended the code at the bottom of this post to server.js. My first act was to add only the one STUN server. This seemed to work well, with no errors. I then surmised that it might be a good idea to add three STUN servers. My thought being that if the first STUN server didn’t catch the peer connection, a subsequent server in the array would. This also seemed to work well, with no errors.


Is my thinking correct on this, or should I be implementing the addition of STUN servers differently? Any help with this greatly appreciated.


Best regards


// My Ice Servers

var myIceServers = [

{"url":"stun:stun.sipgate.net"},

{

"url":"stun:217.10.68.152"},

{

"url":"stun:stun.sipgate.net:10000"},

];

// Set Array Option

easyrtc.setOption("appIceServers", myIceServers);

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Eric Davies

unread,
Mar 13, 2017, 2:02:11 AM3/13/17
to EasyRTC
Using mutliple stun servers as you have done is sensible. If one stun server is down, the others might still be up.
When you go to production, you will need turn servers of course (see the getting started document for explanation).

Reply all
Reply to author
Forward
0 new messages