Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

134
Vistas
Socket.io stops working on handshake after 100+ users

I have a site which, when less than ~100 people are on it, works fine. But after that point, I often get an error saying:

WebSocket connection to ' failed: Error during WebSocket handshake: Unexpected response code: 400

Followed by a bunch of Post errors

GET <my server> 400 (Bad Request)

If I refresh the site a couple times, it works. I am so lost as to why this is happening. Any suggestions?

Here's my code in brief:

//server side
app.set('port', process.env.PORT || 8081);


var server = require('http').createServer(app);
var io = require('socket.io')(server);

server.listen(8081);

//client side

var origin = window.location.origin;
console.log("origin is: " + origin);
var socket = io.connect(origin);

I'm using Express and decided to use socket.io to talk between the app.js(server) and index.html (client). Literally all I'm doing is updating a hashtable on client side. Are there any other alternatives to using socket.io to talk between client and server?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda