Can specify whether the signaling server is secure or not.

This commit is contained in:
Pierre HUBERT 2019-02-02 08:11:11 +01:00
parent faba9b36cb
commit 817ef1069c
2 changed files with 5 additions and 3 deletions

View File

@ -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", () => {

View File

@ -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
);