replace hardcoded ws protocol with wss protocol based on SSL

This commit is contained in:
VladiCz
2026-04-25 10:41:28 +02:00
parent 4bce819918
commit 65f3dcc5d5

View File

@@ -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); export const webSocketManager = new WebSocketManager(wsUrl);