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)=>{