Reputation: 21
I'm using "react-native": "0.60.4" and "socket.io-client": "2.1.1". I create socket connect as below, socket creates but it always on reconnect.
When I use
XMLHttpRequest = GLOBAL.originalXMLHttpRequest ?
GLOBAL.originalXMLHttpRequest :
GLOBAL.XMLHttpRequest;
in my project, it connects, but nothing works.
This is the socket code
let socket = io('http://192.168.0.6:8090', {
transport: ['websocket'],
jsonp: false
});
console.log(socket);
socket.on('reconnecting', (attemptNumber) => {
console.log(attemptNumber + " reconnecting... ")
});
Upvotes: 0
Views: 595
Reputation: 21
Well, finally after 3 days struggling with this, I found the bug, looks like in react native is "transports" not "transport"
Upvotes: 2