fix(webui): explicitly specify websocket protocol (#2578)
All checks were successful
Build / build (push) Successful in 1m18s
Build Docker image / docker-amd64 (push) Successful in 54s
Build Docker image / docker-arm64 (push) Successful in 54s

apparently some browsers (e.g. 2 year old chrome) need this to establish a connection. can't hurt, anyway.

Reviewed-on: #2578
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-08-01 03:47:14 -07:00 committed by Sainan
parent a29398fae6
commit 7e618539fa

View File

@ -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);