From 65f3dcc5d5f7f17162c381f670f52c921c35c807 Mon Sep 17 00:00:00 2001 From: VladiCz Date: Sat, 25 Apr 2026 10:41:28 +0200 Subject: [PATCH] replace hardcoded ws protocol with wss protocol based on SSL --- js/utils/WebSocketManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/utils/WebSocketManager.js b/js/utils/WebSocketManager.js index d0b8e26..9fbb205 100644 --- a/js/utils/WebSocketManager.js +++ b/js/utils/WebSocketManager.js @@ -140,5 +140,7 @@ 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);