"?disconnect=1" response has no allow-origin
Using socket.io with subdomain like "socket.mydomain.com" and client configured sync disconnect on unload to true. and server origins configured to ":"
when I press the refresh button after connection establish, that log appears on console:
XMLHttpRequest cannot load http://socket.mydomain.com:443/socket.io/1//1AMbT-zUoTlrJ1tiw-0H/?disconnect=1. Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin. Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101
socket.io version : 0.9.11 nodejs version : 0.10.4
Hi, I experience the same problem with node 0.8.14 and socket.io 0.9.13. However, it doesn't occur if I downgrade socket.io to 0.9.6.
I have no idea about the real fix, but I changed line 1860 in version 0.9.16 from
xhr.open('GET', uri, false);
to
xhr.open('GET', uri, true);
error went away and disconnect is called.
Because you turned on async method. So, request is still not receiving by server.
http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
:/
Hi folks
Any further info/developments on this issue? I'm experiencing the same, using express.io, which in turn uses 0.9.16 of socket.io. Client and server are running on entirely different domains, as such, have enabled { origins: '*:*' } on the server, as well as 'sync disconnect on unload' on the client. Still get the following error in the browser every time
XMLHttpRequest cannot load https://my-socket-domain.herokuapp/socket.io/1//i01bsbcdiy-s_e-4YFsB/?disconnect=1
No 'Access-Control-Allow-Origin' header is present on the requested resource
Origin 'http://www.some-other-domain.com' is therefore not allowed access
This leaves open sockets idle on the server, which causes errors from the nginx proxy later on.
Happy to try and help look into this, if someone can just point me towards the right place in the source where the disconnect stuff occurs.
+1
+1