node.js – socket.io not connecting reactjs nodejs
server:
const io = socketio(server, {
cors: {
origin: "https://melodybot.me",
methods: ["GET", "POST"],
credentials: true
},
transports: ['websocket', 'polling'],
allowEIO3: true
});```
client:
let connectionOptions = {
“force new connection”: true,
“reconnectionAttempts”: “Infinity”,
“timeout”: 10000,
“transports”: [“websocket”,”polling”],
};
const ws = new io(url, connectionOptions);
in browser its saying connection failed
i want connect socket.io with reactjs and nodejs backeend i am usingg apche ubuntu
Read more here: Source link
