Possibility to set fixed credentials for turn server

master
Daniel Berteaud 10 years ago
parent 5fbdbcd985
commit 34f92c019b
  1. 4
      conf/settings.ini.dist
  2. 18
      templates/default/join.html.ep
  3. 4
      vroom.pl

@ -13,6 +13,10 @@
;stun_server = 'stun:stun.l.google.com:19302' ;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 ; 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' ;turn_server = 'turns:my-turn-server.net:5349?transport=tcp'
; You can use fixed username/login to access turn. If you omit this, VROOM will generate credentials on the fly
; for rfc5766-turn-server in its database
;turn_user = ''
;turn_password = ''
; the realm used for turn accounts. Must match the realm of your turn server ; the realm used for turn accounts. Must match the realm of your turn server
;realm = 'vroom' ;realm = 'vroom'

@ -455,8 +455,22 @@
url: "<%= $config->{'signaling.uri'} %>", url: "<%= $config->{'signaling.uri'} %>",
peerConnectionConfig: { peerConnectionConfig: {
iceServers: [ iceServers: [
{"url":"<%= $config->{'turn.stun_server'} %>"}, {
<%== ($config->{'turn.turn_server'} && $config->{'turn.turn_server'} ne '') ? "{\"url\":\"$config->{'turn.turn_server'}\", \"username\":\"$room\", \"credential\":\"$turnPassword\"}":'' %> "url":"<%= $config->{'turn.stun_server'} %>"
},
<% if ($config->{'turn.turn_server'} && $config->{'turn.turn_server'} ne ''){ %>
{
"url":"<%= $config->{'turn.turn_server'} %>",
<% if ($config->{'turn.turn_user'} && $config->{'turn.turn_user'} ne '' &&
$config->{'turn.turn_password'} && $config->{'turn.turn_password'} ne '') { %>
"username":"<%== $config->{'turn.turn_user'} %>",
"credential":"<%== $config->{'turn.turn_password'} %>"
<% } else { %>
"username":"<%== $room %>",
"credential":"<%== $turnPassword %>"
<% } %>
}
<% } %>
] ]
}, },
localVideoEl: 'webRTCVideoLocal', localVideoEl: 'webRTCVideoLocal',

@ -32,7 +32,9 @@ $config->{'database.user'} ||= 'vroom';
$config->{'database.password'} ||= 'vroom'; $config->{'database.password'} ||= 'vroom';
$config->{'signaling.uri'} ||= 'https://vroom.example.com/'; $config->{'signaling.uri'} ||= 'https://vroom.example.com/';
$config->{'turn.stun_server'} ||= 'stun.l.google.com:19302'; $config->{'turn.stun_server'} ||= 'stun.l.google.com:19302';
$config->{'turn.turn_server'} ||= ''; $config->{'turn.turn_server'} ||= undef;
$config->{'turn.turn_user'} ||= undef;
$config->{'turn.turn_password'} ||= undef;
$config->{'turn.realm'} ||= 'vroom'; $config->{'turn.realm'} ||= 'vroom';
$config->{'email.from '} ||= 'vroom@example.com'; $config->{'email.from '} ||= 'vroom@example.com';
$config->{'email.contact'} ||= 'admin@example.com'; $config->{'email.contact'} ||= 'admin@example.com';

Loading…
Cancel
Save