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

323
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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