ipc: allow wss

This commit is contained in:
jean-emmanuel 2019-04-03 21:08:50 +02:00
parent 6d4a32f20e
commit fdfefb171e

View file

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