Do not hardcode stun and turn scheme

Instead, read a ful uri from the config, so you can specify turns if you want
master
Daniel Berteaud 10 years ago
parent 77c0a43ae3
commit 8ecbeb32a6
  1. 10
      conf/settings.ini.dist
  2. 4
      templates/default/join.html.ep

@ -9,11 +9,11 @@
;uri = 'https://vroom.exmple.com' ;uri = 'https://vroom.exmple.com'
[turn] [turn]
; The stun server sent to client. You can set it to your own stun server ; 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.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 ; 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 = '' ;turn_server = 'turns:my-turn-server.net:5349?transport=tcp'
; the realm used for turn accounts. You shouldn't have to change it ; the realm used for turn accounts. Must match the realm of your turn server
;realm = 'vroom' ;realm = 'vroom'
[email] [email]

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

Loading…
Cancel
Save