From 540bbbdb825fe1b02557da2658b7cbe9e643c707 Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:53:21 +0000 Subject: [PATCH] Handle https when creating socket --- webshit/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webshit/index.html b/webshit/index.html index d5027665..c3f56afc 100644 --- a/webshit/index.html +++ b/webshit/index.html @@ -490,7 +490,7 @@ document.addEventListener('drop', (event) => { if(ws) return; let opened = false; - ws = new WebSocket(`ws://${location.host}/ws`); + ws = new WebSocket(`ws${window.location.protocol === "https"? "s" : ""}://${location.host}/ws`); ws.addEventListener("open", () => { opened = true;