This commit is contained in:
frontend perkafean
2024-09-18 08:40:55 +00:00
parent f46639e05c
commit dbc43d18fa
18 changed files with 310 additions and 166 deletions

View File

@@ -1,6 +1,13 @@
import socketIOClient from 'socket.io-client';
import API_BASE_URL from '../config.js';
import socketIOClient from "socket.io-client";
import API_BASE_URL from "../config.js";
const socket = socketIOClient(API_BASE_URL);
const socket = socketIOClient(API_BASE_URL, {
transports: ["websocket"], // Use WebSocket for better performance
reconnection: true, // Enable automatic reconnection
reconnectionAttempts: Infinity, // Set to Infinity to keep trying
reconnectionDelay: 1000, // Time in ms to wait before attempting reconnection
reconnectionDelayMax: 5000, // Max delay in ms for reconnection attempts
timeout: 20000, // Connection timeout
});
export default socket;