diff --git a/lib/store.ts b/lib/store.ts index 1f84069..6663ec6 100644 --- a/lib/store.ts +++ b/lib/store.ts @@ -43,7 +43,8 @@ export const useGameStore = create((set, get) => ({ pendingPlayerName: null, initSocket: () => { - const socket = io('http://localhost:3000', { + const socketUrl = process.env.NEXT_PUBLIC_SOCKET_URL || 'http://localhost:3000'; + const socket = io(socketUrl, { transports: ['websocket', 'polling'], });