From 8ecbeb32a610d40f2db96f4d854c121d26a15ffc Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 19 Feb 2015 22:25:35 +0100 Subject: [PATCH] Do not hardcode stun and turn scheme Instead, read a ful uri from the config, so you can specify turns if you want --- conf/settings.ini.dist | 10 +++++----- templates/default/join.html.ep | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/settings.ini.dist b/conf/settings.ini.dist index 1e0b70f..d51f4f2 100644 --- a/conf/settings.ini.dist +++ b/conf/settings.ini.dist @@ -9,11 +9,11 @@ ;uri = 'https://vroom.exmple.com' [turn] -; The stun server sent to client. You can set it to your own stun server -;stun_server = 'stun.l.google.com:19302' -; The turn server sent to cliet, you should set it to your own server -;turn_server = '' -; the realm used for turn accounts. You shouldn't have to change it +; The stun server sent to client. You can set it to your own stun server. Takes a full stun uri as defined by rfc7064 +;stun_server = 'stun:stun.l.google.com:19302' +; The turn server sent to cliet, you should set it to your own server. Takes a full turn uri as defined by rfc7065 +;turn_server = 'turns:my-turn-server.net:5349?transport=tcp' +; the realm used for turn accounts. Must match the realm of your turn server ;realm = 'vroom' [email] diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 0ec2d82..6fdf7e0 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -455,8 +455,8 @@ url: "<%= $config->{'signaling.uri'} %>", peerConnectionConfig: { iceServers: [ - {"url":"stun:<%= $config->{'turn.stun_server'} %>"}, - <%== ($config->{'turn.turn_server'} && $config->{'turn.turn_server'} ne '') ? "{\"url\":\"turn:$config->{'turn.turn_server'}\", \"username\":\"$room\", \"credential\":\"$turnPassword\"}":'' %> + {"url":"<%= $config->{'turn.stun_server'} %>"}, + <%== ($config->{'turn.turn_server'} && $config->{'turn.turn_server'} ne '') ? "{\"url\":\"$config->{'turn.turn_server'}\", \"username\":\"$room\", \"credential\":\"$turnPassword\"}":'' %> ] }, localVideoEl: 'webRTCVideoLocal',