Last modified: 2014-06-05 18:26:57 UTC
Example: * Using socket.io 0.9.16 from cdnjs.cloudflare.com: http://codepen.io/Krinkle/full/eGDqc - Makes one failed XHR connection. - Emits 'error' event. - Nothing else is attempted. XMLHttpRequest cannot load http://stream.wikimedia.org/socket.io/1/?t=1401989718292. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. * Using socket.io 1.0.4 from cdn.socket.io: http://codepen.io/Krinkle/full/laucI - Seems to make infinite attempts at XHR polling. - Never emits 'error' event. - Nothing else is attempted. XMLHttpRequest cannot load http://stream.wikimedia.org/socket.io/?EIO=2&transport=polling&t=1401989761220-0. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. laucI:1 XMLHttpRequest cannot load http://stream.wikimedia.org/socket.io/?EIO=2&transport=polling&t=1401989762334-1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. laucI:1 XMLHttpRequest cannot load http://stream.wikimedia.org/socket.io/?EIO=2&transport=polling&t=1401989764464-2. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://s.codepen.io' is therefore not allowed access. laucI:1 -- Searching for this error on Google yields loads of results. People are running into this a lot. Mostly when dealing with loading the socket.io.js from another domain (not sure whether they need it to be the client domain, codepen in this case, or the target domain, stream.wikimedia.org in this case). Either way, it looks like enabling CORS might mitigate this problem. However I'm concerned about two things: 1) Why is it not trying other transports? (like, wtf, WebSockets?) 2) If we enable CORS, that might work for modern browsers, but we still need it to fallback to other things, like jsonp.
This issue has been resolved. I changed http://codepen.io/Krinkle/full/laucI back to using v0.9.16 because v 1.0.4 is still not working for some reason. Fixed by: > operations/puppet.git > Change-Id: If31ac6e2cdb18ac40377a659a2850c6fcc90076a .. because the CORS error really was just a 404 error in disguise.