From 020dbc86115bca784a2a500a1be7c83083fa506c Mon Sep 17 00:00:00 2001 From: Process-ing Date: Sat, 9 Nov 2024 19:39:46 +0000 Subject: [PATCH] Make WebSocket URL schema dynamic --- src/api/socket.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/socket.ts b/src/api/socket.ts index 2ad9e109..d516de0d 100644 --- a/src/api/socket.ts +++ b/src/api/socket.ts @@ -1,7 +1,7 @@ import { io, Socket } from "socket.io-client"; import backendApi from "./backend"; -const SOCKET_URL = 'ws://' + backendApi.BACKEND_URL.split('//')[1]; +const SOCKET_URL = (import.meta.env.VITE_APP_PROD == 0 ? 'ws://' : 'wss://') + backendApi.BACKEND_URL.split('//')[1]; class OptionalSocket { private socket: Socket | null;