use relative URL for websocket

This commit is contained in:
schnusch 2021-12-31 16:41:47 +01:00
parent 55b0ba894e
commit 47e9bb2047

View file

@ -346,8 +346,7 @@ window.addEventListener("load", function() {
showScene(opening); showScene(opening);
ws = new WebSocket( ws = new WebSocket(
(location.protocol == "http:" ? "ws:" : "wss:") + "//" + location.hostname + String(new URL("ws", location.href)).replace(/^http/, "ws")
(location.port ? ":" + location.port : "") + "/ws"
); );
ws.onmessage = function(evt) { ws.onmessage = function(evt) {