3
votes

I am getting below message

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http:///socket.io/?EIO=3&transport=polling&t=1414700673061-7. This can be fixed by moving the resource to the same domain or enabling CORS.

I did try :

io.set( "origins", "*:*" );
io.sockets.on('connection', function (socket) { });

Where I am wrong.

1

1 Answers

0
votes

Don't forget to set the same address you have in your server, including the port:

"<"script">"

var socket = io('http://localhost:8080');

...

Remember the socket on your server is not the same that the socket on your client.