服务器:
const io = socketio(server, {
cors: {
origin: "https://melodybot.me",
methods: ["GET", "POST"],
credentials: true
},
transports: ['websocket', 'polling'],
allowEIO3: true
});```
client:
让 connectionOptions = { “强制新连接”:是的, "reconnectionAttempts": "无限", “超时”:10000, “传输”:[“websocket”,“轮询”], }; 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