fix websocket with https
This commit is contained in:
parent
b5ed8ee23b
commit
2fe8fb47b3
2 changed files with 12 additions and 8 deletions
File diff suppressed because one or more lines are too long
|
|
@ -312,7 +312,11 @@ window.addEventListener("load", function() {
|
||||||
keyboard.style.display = "none";
|
keyboard.style.display = "none";
|
||||||
text.value = "";
|
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 : "") +
|
(location.port ? ":" + location.port : "") +
|
||||||
"/ws");
|
"/ws");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue