Cannot GET /socket.io/?EIO=3&transport=polling&t=LdmmKYz

I found my problem !

my problem was at the server code :

var server = app.listen(8810)
var io = require('socket.io').listen(server);

just this was the problem.

I needed to define where the socket.io listen without it the socket failed .

change it and the error will disappeared.


Try this in the exact order if you are using express 4.

var express = require('express');
var app = express();
var server = app.listen(8810);
var io = require('socket.io').listen(server);

Refer to the API reference here