-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Error while hosting on render, didn't able to connect with io server( or didn't know how to connect) #4771
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
👎 1
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
-
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/
Beta Was this translation helpful? Give feedback.
All reactions
-
Sir the Problem is now resolved, Thank you for reply
Beta Was this translation helpful? Give feedback.
All reactions
-
how were you able to host a socket on render
Beta Was this translation helpful? Give feedback.
All reactions
-
how you resolved it?
Beta Was this translation helpful? Give feedback.
All reactions
-
when you have a solution to your problem you should tell.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
-
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
Beta Was this translation helpful? Give feedback.