V1.0.1
Connect over polling first so the game still works when a proxy drops the websocket upgrade. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,9 @@ import { io } from 'socket.io-client';
|
||||
import type { JoinAck } from '@two-keys/shared';
|
||||
import { pushToast } from './toasts';
|
||||
|
||||
export const socket = io({ transports: ['websocket', 'polling'] });
|
||||
// Polling first, then upgrade: a websocket-first client never falls back, so a proxy that
|
||||
// drops the Upgrade header would leave it unable to connect at all.
|
||||
export const socket = io();
|
||||
|
||||
socket.on('toast', ({ message }: { message: string }) => pushToast(message));
|
||||
socket.on('error', ({ message }: { message: string }) => pushToast(message, 'error'));
|
||||
|
||||
Reference in New Issue
Block a user