[mirotalk] - try openrelay stun-turn

This commit is contained in:
Miroslav Pejic
2022-03-08 13:08:59 +01:00
parent 2798085db0
commit 856d8460d1
+33 -6
View File
@@ -250,14 +250,41 @@ app.get('*', function (req, res) {
* Check the functionality of STUN/TURN servers:
* https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
*/
const iceServers = [{ urls: 'stun:stun.l.google.com:19302' }];
const iceServers = [];
if (turnEnabled == 'true') {
iceServers.push({
urls: turnUrls,
username: turnUsername,
credential: turnCredential,
});
iceServers.push(
{
urls: 'stun:stun.l.google.com:19302',
},
{
urls: turnUrls,
username: turnUsername,
credential: turnCredential,
},
);
} else {
// Thanks to https://www.metered.ca/tools/openrelay/
iceServers.push(
{
urls: 'stun:openrelay.metered.ca:80',
},
{
urls: 'turn:openrelay.metered.ca:80',
username: 'openrelayproject',
credential: 'openrelayproject',
},
{
urls: 'turn:openrelay.metered.ca:443',
username: 'openrelayproject',
credential: 'openrelayproject',
},
{
urls: 'turn:openrelay.metered.ca:443?transport=tcp',
username: 'openrelayproject',
credential: 'openrelayproject',
},
);
}
/**