Use relative URL for websocket
Partially merged from branch 'schnusch-http-prefix'
This commit is contained in:
commit
130c430d3d
2 changed files with 5 additions and 6 deletions
|
|
@ -345,10 +345,9 @@ window.addEventListener("load", function() {
|
|||
text.value = "";
|
||||
showScene(opening);
|
||||
|
||||
ws = new WebSocket(
|
||||
(location.protocol == "http:" ? "ws:" : "wss:") + "//" + location.hostname +
|
||||
(location.port ? ":" + location.port : "") + "/ws"
|
||||
);
|
||||
let wsURL = new URL("ws", location.href);
|
||||
wsURL.protocol = wsURL.protocol == "http:" ? "ws:" : "wss:";
|
||||
ws = new WebSocket(wsURL);
|
||||
|
||||
ws.onmessage = function(evt) {
|
||||
if (authenticated) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue