fix ws protocol

This commit is contained in:
CodedSakura 2024-10-18 21:22:08 +03:00
parent 09f1500439
commit 366aa9f2b0
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@
document.getElementById("msgBox").value = ""; document.getElementById("msgBox").value = "";
}); });
const ws = new WebSocket("ws://" + window.location.host); const ws = new WebSocket("ws" + (window.location.protocol === "https:" ? "s" : "") + "://" + window.location.host);
ws.addEventListener("message", ({ data: msg }) => { ws.addEventListener("message", ({ data: msg }) => {
console.log(msg); console.log(msg);