From eae1c2d2c3f10122c689007be4110417901c8ec6 Mon Sep 17 00:00:00 2001 From: Dariusz L Date: Fri, 1 May 2026 20:34:51 +0200 Subject: [PATCH] Update WebSocketManager.ts --- src/utils/WebSocketManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/WebSocketManager.ts b/src/utils/WebSocketManager.ts index 7292485..c0bf6c3 100644 --- a/src/utils/WebSocketManager.ts +++ b/src/utils/WebSocketManager.ts @@ -168,5 +168,6 @@ class WebSocketManager { } } -const wsUrl = `ws://${window.location.host}/layerforge/canvas_ws`; +const protocol = location.protocol === "https:" ? "wss:" : "ws:"; +const wsUrl = `${protocol}//${location.host}/layerforge/canvas_ws`; export const webSocketManager = new WebSocketManager(wsUrl);