Skip to content

Commit

Permalink
Make WebSocket URL schema dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Process-ing committed Nov 9, 2024
1 parent 807da66 commit 020dbc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/socket.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 020dbc8

Please sign in to comment.