Do not hardcode websocket host
This commit is contained in:
parent
7aed274e63
commit
0b65c79a89
|
@ -95,7 +95,11 @@
|
|||
var queue = [];
|
||||
var archive = [];
|
||||
|
||||
var exampleSocket = new WebSocket("ws://Marvins-MacBook-Pro.local:8000/ws");
|
||||
// Construct websocket url
|
||||
var loc = window.location;
|
||||
var ws_url = ((loc.protocol === "https:") ? "wss://" : "ws://") + loc.host + "/ws";
|
||||
|
||||
var exampleSocket = new WebSocket(ws_url);
|
||||
exampleSocket.onopen = function (event) {
|
||||
console.log("WS: Connection open");
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue