fix websocket with https

This commit is contained in:
Unrud 2018-06-26 06:02:11 +02:00
parent b5ed8ee23b
commit 2fe8fb47b3
2 changed files with 12 additions and 8 deletions

File diff suppressed because one or more lines are too long

View file

@ -312,7 +312,11 @@ window.addEventListener("load", function() {
keyboard.style.display = "none";
text.value = "";
ws = new WebSocket("ws://" + location.hostname +
var wsProtocol = "wss:";
if (location.protocol == "http:") {
wsProtocol = "ws:";
}
ws = new WebSocket(wsProtocol + "//" + location.hostname +
(location.port ? ":" + location.port : "") +
"/ws");