From fdfefb171ebf095b6a4bd3d87b8817647176ddab Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 3 Apr 2019 21:08:50 +0200 Subject: [PATCH] ipc: allow wss --- src/client/app/ipc/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/app/ipc/index.js b/src/client/app/ipc/index.js index a146a048..288e4524 100644 --- a/src/client/app/ipc/index.js +++ b/src/client/app/ipc/index.js @@ -10,7 +10,8 @@ setTimeout(()=>{ var reconnectInterval = 5000, hearbeatInterval = 25000, - hearbeatTimeout = 5000 + hearbeatTimeout = 5000, + protocol = document.location.protocol === 'https:' ? 'wss://' : 'ws://' class Ipc extends EventEmitter { @@ -58,7 +59,7 @@ class Ipc extends EventEmitter { open() { - this.socket = new WebSocket('ws://' + window.location.host + '/' + uuid) + this.socket = new WebSocket(protocol + window.location.host + '/' + uuid) this.socket.onopen = (e)=>{