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

183
Vistas
Establish socket.io connection to heroku app

I am hosting my socket.io server on heroku and I am running the client-side of the application on localhost. On the frontend I establish the socket.io connection like this:

const socket = io("https://<my-app-name>.herokuapp.com:5000/");

And the backend looks like this:

const port = 5000;
const io = require("socket.io")(port, { cors: { origin: "*" } });
io.on("connection", (socket) => { console.log(socket.id) }

But the connection won't establish and in the console of my browser I receive this error:

GET https://<my-app-name>.herokuapp.com:5000/socket.io/?EIO=4&transport=polling&t=Nym-K6b net::ERR_CONNECTION_TIMED_OUT

BTW it works just fine when I'm running the server-side on my localhost too.

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

0

https://socket.io/docs/v4/troubleshooting-connection-issues/#the-server-is-not-reachable

Please make sure the Socket.IO server is actually reachable at the given URL. You can test it with: curl "<the server URL>/socket.io/?EIO=4&transport=polling" which should return something like this: 0{"sid":"Lbo5JLzTotvW3g2LAAAA","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000}. If that's not the case, please check that the Socket.IO server is running, and that there is nothing in between that prevents the connection.

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