Socket.IO infinite loop when connected

Socket.IO make an endless connection loop! This is strange and never happens until now. I do not know what happened. I am trying to rebuild the package, I will copy the code from an older source and the same result ...

io.on('connection', function(socket){
  console.log('someone connected << infinite loop');
});

This is the core ExpressJS server with http on top.

const
port        = process.env.PORT || 3200,
app         = require('express')(),
express     = require('express'),
mysql       = require('mysql'),
bodyParser  = require('body-parser'),
path        = require('path'),
methodOverride = require('method-override'),
http        = require('http').Server(app),
io          = require('socket.io')(http);

Client

var socket = io();
+4
source share
1 answer

The problem was on the client side, I do not download the latest version of socket.io, as on the server side. In my .json package I have 2.0.3, and on the client side - 1.2.0. For everyone who has this problem

+13
source

Source: https://habr.com/ru/post/1680753/


All Articles