Skip to content

Commit ae27cb4

Browse files
update frontend for vercel to try socket.io
1 parent 10b4c6d commit ae27cb4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Frontend/src/context/SocketContext.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { io } from 'socket.io-client';
33

44
export const SocketContext = createContext();
55

6-
const socket = io(`${import.meta.env.VITE_BASE_URL}`); // Replace with your server URL
6+
const socket = io(`${import.meta.env.VITE_BASE_URL}`, {
7+
transports: ['websocket', 'polling'], // Use polling as a fallback
8+
}); // Replace with your server URL
79

810
const SocketProvider = ({ children }) => {
911
useEffect(() => {
@@ -21,3 +23,4 @@ const SocketProvider = ({ children }) => {
2123
};
2224

2325
export default SocketProvider;
26+

0 commit comments

Comments
 (0)