Nodejs websocket sends EIO=3&transport=polling&t

use nodejs to connect to websocket and keep requesting the following connections



http://localhost:8808/socket.io/?EIO=3&transport=polling&t=MXCRWHD
Jul.02,2022

before I use socket.io, there will be the kind of error you mentioned, and then the server will be changed to the following.

var app = express ();
var server = app.listen (8000);
var io = require ('socket.io') .initiate (server);
io.on (' connection', function (socket) {
console.log ('connection successful')
});

Menu