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