• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

263
Vistas
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 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

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 3 years ago · Juan Pablo Isaza Denunciar
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda