From 7e618539fa2e8aa5dfaf80ee4421760b470233ed Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Fri, 1 Aug 2025 03:47:14 -0700 Subject: [PATCH] fix(webui): explicitly specify websocket protocol (#2578) apparently some browsers (e.g. 2 year old chrome) need this to establish a connection. can't hurt, anyway. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2578 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- static/webui/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/webui/script.js b/static/webui/script.js index 1625216c..57da8a51 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -28,7 +28,8 @@ const sendAuth = isRegister => { }; function openWebSocket() { - window.ws = new WebSocket("/custom/ws"); + const wsProto = location.protocol === "https:" ? "wss://" : "ws://"; + window.ws = new WebSocket(wsProto + location.host + "/custom/ws"); window.ws.onopen = () => { ws_is_open = true; sendAuth(false);