We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10b4c6d commit ae27cb4Copy full SHA for ae27cb4
Frontend/src/context/SocketContext.jsx
@@ -3,7 +3,9 @@ import { io } from 'socket.io-client';
3
4
export const SocketContext = createContext();
5
6
-const socket = io(`${import.meta.env.VITE_BASE_URL}`); // Replace with your server URL
+const socket = io(`${import.meta.env.VITE_BASE_URL}`, {
7
+ transports: ['websocket', 'polling'], // Use polling as a fallback
8
+}); // Replace with your server URL
9
10
const SocketProvider = ({ children }) => {
11
useEffect(() => {
@@ -21,3 +23,4 @@ const SocketProvider = ({ children }) => {
21
23
};
22
24
25
export default SocketProvider;
26
+
0 commit comments