The real problem I'm having is that socket.io-client is unable to connect via the polling transport when running the chrome debugger. This is because it's a cross-domain request (debugger port is 8081 whereas my local server is running on port 3000) and socket.io in that case will only use XMLHttpRequest if it supports CORS.
socket.io-client checks for CORS like this:
module.exports = typeof XMLHttpRequest !== 'undefined' &&
'withCredentials' in new XMLHttpRequest();
which fails and ultimately it has to fall back on WS. That isn't so terrible but made for some very confusing debugging. I'd prefer for the behavior while debugging to be as close as possible to running the real app.
Am happy to submit a PR if this makes sense. (FYI this is on react-native 0.18.0-rc)
The real problem I'm having is that socket.io-client is unable to connect via the polling transport when running the chrome debugger. This is because it's a cross-domain request (debugger port is 8081 whereas my local server is running on port 3000) and socket.io in that case will only use XMLHttpRequest if it supports CORS.
socket.io-client checks for CORS like this:
which fails and ultimately it has to fall back on WS. That isn't so terrible but made for some very confusing debugging. I'd prefer for the behavior while debugging to be as close as possible to running the real app.
Am happy to submit a PR if this makes sense. (FYI this is on react-native 0.18.0-rc)