Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!