Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda