From 817ef1069c1c7a40b7c206ae57e33633bc539c25 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 2 Feb 2019 08:11:11 +0100 Subject: [PATCH] Can specify whether the signaling server is secure or not. --- .../3rdparty/SignalExchangerClient/SignalExchangerClient.js | 5 +++-- assets/js/components/calls/callWindow.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/3rdparty/SignalExchangerClient/SignalExchangerClient.js b/assets/3rdparty/SignalExchangerClient/SignalExchangerClient.js index 8a4b413b..73e43601 100644 --- a/assets/3rdparty/SignalExchangerClient/SignalExchangerClient.js +++ b/assets/3rdparty/SignalExchangerClient/SignalExchangerClient.js @@ -75,15 +75,16 @@ class SignalExchangerClient { * @param {String} domain The name of the signal server * @param {Number} port The port of the server to use * @param {String} clientID The ID of current client + * @param {Boolean} secure Specify whether connection to the socket should be secure or not */ - constructor(domain, port, clientID) { + constructor(domain, port, clientID, secure) { //Save information this.domain = domain, this.port = port; this.clientID = clientID; - this.socket = new WebSocket("ws://" + this.domain + ":" + this.port + "/socket"); + this.socket = new WebSocket((secure ? "wss" : "ws") + "://" + this.domain + ":" + this.port + "/socket"); //Add a few events listeners this.socket.addEventListener("open", () => { diff --git a/assets/js/components/calls/callWindow.js b/assets/js/components/calls/callWindow.js index 4b40ea66..7f6fcb21 100644 --- a/assets/js/components/calls/callWindow.js +++ b/assets/js/components/calls/callWindow.js @@ -535,7 +535,8 @@ ComunicWeb.components.calls.callWindow = { call.signalClient = new SignalExchangerClient( config.signal_server_name, config.signal_server_port, - call.localPeerID + call.localPeerID, + config.is_signal_server_secure );