From 366aa9f2b02b5e02d117d9affe93934f4c3b67eb Mon Sep 17 00:00:00 2001 From: CodedSakura Date: Fri, 18 Oct 2024 21:22:08 +0300 Subject: [PATCH] fix ws protocol --- public/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index d7ba800..e7932d2 100644 --- a/public/index.html +++ b/public/index.html @@ -72,7 +72,7 @@ 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 }) => { console.log(msg);