Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

78
Vistas
Socket.io v3 Unsupported protocol version error

I'm stuck with the newer version of socket.io. Everything was fine but when I wanted to upgrade to socket.io 3, everything just broke, and currently on the client, I'm getting a 400 HTTP status code with the following JSON response - {"code":5,"message":"Unsupported protocol version"}

Server-side config -

const io = require("socket.io")(server, {
    cors: {
      origin: config.clientURL,
      methods: ["GET", "POST"],
      credentials: true,
    },
  });

Client-side config -

const socket = io(backendURL, {
  withCredentials: true,
});

I've tried very many things and redeployed many times but the error didn't go away.

For reference, I've these github repos -

Client in react.js - GitHub repo

Server in nodeJs and socket.io.js - GitHub repo

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Looks like there may be a mismatch between versions of your socket.io-client and socket.io server.

First, update the servers with allowEIO3 set to true (added in socket.io@3.1.0)

const io = require("socket.io")({
  allowEIO3: true // false by default
});

After you've upgraded the socket.io-client (latest right now is 3.1.1), you can set it back, or remove it since default is false

const io = require("socket.io")({
  allowEIO3: false
});

over 4 years ago · Santiago Trujillo Denunciar

0

I install old version by

npx create-nuxt-app@2.15.0

It will install nuxt with express.js in one project. Then update npm packages by commands:

npx npm-check-updates -u
npm i

And socket.io goes well between nuxt and socket.io on server

over 4 years ago · Santiago Trujillo 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda