ws or wss
This commit is contained in:
parent
1ab097bc29
commit
712154dd8a
|
@ -139,7 +139,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initWebSocket() {
|
initWebSocket() {
|
||||||
const uri = "ws://" + window.location.host + "/performance/report/" + this.reportId;
|
let protocol = "ws://";
|
||||||
|
if (window.location.protocol === 'https:') {
|
||||||
|
protocol = "wss://";
|
||||||
|
}
|
||||||
|
const uri = protocol + window.location.host + "/performance/report/" + this.reportId;
|
||||||
this.websocket = new WebSocket(uri);
|
this.websocket = new WebSocket(uri);
|
||||||
this.websocket.onmessage = this.onMessage;
|
this.websocket.onmessage = this.onMessage;
|
||||||
this.websocket.onopen = this.onOpen;
|
this.websocket.onopen = this.onOpen;
|
||||||
|
|
Loading…
Reference in New Issue