Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error while hosting on render, didn't able to connect with io server( or didn't know how to connect) #4771

Answered by darrachequesne
Vansh1190 asked this question in Q&A
Discussion options

I am building a chat application with socket.io and for the routes i used express router and
For realtime chatting i used socket.io.
The application is running very good in my local server,
My backend is running on port 3000
And my socket is running on port 3002
But when i hosted it on render, it gives me an error that,
The frontend is not able to connect with my socket.
I used io.connect(https://renderUrl.com:3002)
Not working!
Here's the link to my repo. - https://github.com/Vansh1190/chatverse-backend

Please help its very urgent

You must be logged in to vote

Hi! It seems that you are not able to reach the Socket.IO server. Could you please check if the port 3002 is open on your hosting platform? Or could you switch to 443?

See also: https://socket.io/docs/v4/troubleshooting-connection-issues/

Replies: 1 comment 5 replies

Comment options

Hi! It seems that you are not able to reach the Socket.IO server. Could you please check if the port 3002 is open on your hosting platform? Or could you switch to 443?

See also: https://socket.io/docs/v4/troubleshooting-connection-issues/

You must be logged in to vote
5 replies
Comment options

Sir the Problem is now resolved, Thank you for reply

Comment options

how were you able to host a socket on render

Comment options

how you resolved it?

Comment options

when you have a solution to your problem you should tell.

Comment options

Sir uses a node.js as a server hosting http server and io server. ExpressJS and Socket.IO can reuse one port.
Did the same thing many years ago and it was working.
https://doc.scalingo.com/languages/nodejs/websocket-web-same-port

Answer selected by darrachequesne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /