I have morgan logger middleware in my express server and it is logging some weird GET requests like
GET /socket.io/?X_LOCAL_SECURITY_COOKIE=&EIO=3&transport=polling&t=1677999959451-699 404 362 - 2.363 ms
.
I am a little new to this, so I was wondering what is the thing that is causing this.My node_modules do not contain any socket.io module.
I have tried tracing it in the server but I am not able to find the source of this. Also, my middleware setup looks like this ->
//middlewares defined!
app.use(express.static(path.join(__dirname, '/public'))); //static files
app.use(express.json()); //json files
app.use(express.urlencoded({ extended: true })); //form data parser
app.use(cookieParser()); //cookie parser
//towards router
app.use('/', authRouter);
app.use('/', userRouter);
//notFound
app.use(notFound);
You might no longer have this issue, but if there's another application on your machine attempting to connect to a socket.io server on the same port used by Express, it could cause a conflict.
In many cases, this is due to the In-Game Overlay of NVidia GeForce Experience. You can refer to this explanation to identify the source of the issue: Superuser Link.
The most efficient solution is to restart your device, which will allow applications to reset their connections and free up the port.