Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

84
Vistas
why i get an error on slow connections in Socket io v4

when i use socke.io at normal internet speed it works fine.But when I simulate a slow 3G in the chrome developer console.

This error is displayed:

failed: WebSocket is closed before the connection is established.

How do I configure socket.io for slow internet connection?

This is my configuration:

   io("ws:xxxxx.xxxx", {
        transports: ["websocket"],
        upgrade: true,
        path: "messenger",
        query: {
          token: "xxxxxxxxxx",
        },
        timeout: 1000,
    });

note: this configuration works on a fast connection.

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You're closing the socket before socketio has a chance to connect. Increase the timeout value to around 10000 (10 seconds), and that should solve your issue.

7 months 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 empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.