I know this question has been asked a couple of times.
However, I can\'t get any those solutions to work.
I\'m running a standard install of node.js and socket.
This is the syntax I had to use to get CORS working with socket.io:
io.set( 'origins', '*domain.com*:*' );
If it comes to it, use console.log
to make sure you're entering this block of code in Manager.prototype.handleHandshake
inside ./lib/manager.js
:
if (origin) {
// https://developer.mozilla.org/En/HTTP_Access_Control
headers['Access-Control-Allow-Origin'] = '*';
if (req.headers.cookie) {
headers['Access-Control-Allow-Credentials'] = 'true';
}
}