ERR_CONNECTION_TIMED_OUT socket.io
Hey, i have this error connecting my nextjs frontend with my backend node.
The websocket connection is not working properly.
Any help?
18 Replies
Project ID:
N/A
you are specifying the port as 1101 but you can only access your app externally from 443
oh
i will change it to 443 and try again
you don't need to change to 443, just remove the port from the url as port 443 is implied when using https / wss
in the front you mean?
yes
in the socketio client constructor
ok i am deploying
thanks for the moment
telling you in a few mins
i have the url in the allow list
does your socket.io server listen on a different port than your http server?
client now listen to https://.........-backend-production-0151.up.railway.app
and backend listen to 1101
but you told me to don't change it
please read this https://docs.railway.app/guides/fixing-common-errors
server.listen(process.env.SERVER_PORT, "0.0.0.0",
() => console.log(
Server is running on port: ${process.env.SERVER_PORT}
));you need to listen on the PORT variable instead
ahn it is an automated var from railway?
correct
oh now it make sense
thanks bud
testing now
you are Amazing💯
seems working
200
happy to help!