Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!