make websockets use wss if https
This commit is contained in:
parent
9af6c9ee26
commit
8f996c03d3
1 changed files with 2 additions and 1 deletions
|
@ -91,7 +91,8 @@
|
|||
|
||||
const network = new vis.Network(container, data, options);
|
||||
|
||||
var ws = new WebSocket(`ws://${window.location.hostname}:3012`);
|
||||
|
||||
var ws = new WebSocket(`${window.location.protocol.startsWith("https") ? 'wss' : 'ws'}://${window.location.hostname}:3012`);
|
||||
ws.onmessage = function (event) {
|
||||
handle_event(JSON.parse(event.data));
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue