use relative URL for websocket
This commit is contained in:
parent
55b0ba894e
commit
47e9bb2047
1 changed files with 1 additions and 2 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue