diff --git a/apps/client/src/common/api/apiConstants.ts b/apps/client/src/common/api/apiConstants.ts index 36bf11324..714af6c81 100644 --- a/apps/client/src/common/api/apiConstants.ts +++ b/apps/client/src/common/api/apiConstants.ts @@ -14,7 +14,7 @@ export const RUNTIME = ['runtimeStore']; export const serverPort = import.meta.env.DEV ? STATIC_PORT : window.location.port; export const serverURL = import.meta.env.DEV ? `http://localhost:${serverPort}` : window.location.origin; -export const websocketUrl = `ws://${window.location.hostname}:${serverPort}/ws`; +export const websocketUrl = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.hostname}:${serverPort}/ws`; export const eventURL = `${serverURL}/eventdata`; export const rundownURL = `${serverURL}/events`;