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

224
Vistas
Prevent mqtt.js to disconnect in browser

Short

Is there a way of preventing mqtt in the browser to disconnect when the browser loses focus?

The long one

Previously I used Paho mqtt from a browser talking to a secure web socket. Paho sometimes had trouble setting up the connection with Paho therefore we changed to mqtt.js

I find it much better at setting up the connection.

But, when I leave the browser for a while it seems to disconnect, however it connects really quick again when the tab gets the focus back.

I can see the reason for having a timeout function, but it should be possible to turn it off.

Is it?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This will be down to the browser suspending the tab when it's not visible to save resources (e.g. battery on mobile devices/laptops) and memory by swapping out the page.

In this case it is unlikely you will be able to influence this from within the page (as this would defeat the point)

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