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

325
Views
Socket.io is not returning a valid HTTP response

I am using socket.io and using this guide to implement it and the server is able to start up with no errors. But whenever I try connecting to the WebSocket from the server I am getting an error similar to this: Did not receive a valid HTTP response.

I am initializing socket.io with this code:

const socketio = new Server(http, {
  serveClient: false,
  pingInterval: 10000,
  pingTimeout: 5000,
});

Edit:

I am trying to connect to the WebSocket with this URL: ws://localhost:8000 using Python's WebSocket package. I used their example which is this:

import asyncio
import websockets

async def connect():
    await websockets.connect("ws://localhost:8000")

asyncio.run(connect())

Edit I made it work by using the wss package instead

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Check the port the server is listening to and match both client and server. You should avoid low ports because those are used for common known apps and your system may piss you off by using them. 5 digits should be enough

about 4 years ago · Juan Pablo Isaza Report
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!