R
Railway•10mo ago
ZannaKonda

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?
No description
18 Replies
Percy
Percy•10mo ago
Project ID: N/A
Brody
Brody•10mo ago
you are specifying the port as 1101 but you can only access your app externally from 443
ZannaKonda
ZannaKondaOP•10mo ago
oh i will change it to 443 and try again
Brody
Brody•10mo ago
you don't need to change to 443, just remove the port from the url as port 443 is implied when using https / wss
ZannaKonda
ZannaKondaOP•10mo ago
in the front you mean?
Brody
Brody•10mo ago
yes in the socketio client constructor
ZannaKonda
ZannaKondaOP•10mo ago
ok i am deploying thanks for the moment telling you in a few mins
ZannaKonda
ZannaKondaOP•10mo ago
No description
ZannaKonda
ZannaKondaOP•10mo ago
i have the url in the allow list
Brody
Brody•10mo ago
does your socket.io server listen on a different port than your http server?
ZannaKonda
ZannaKondaOP•10mo ago
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
ZannaKonda
ZannaKondaOP•10mo ago
server.listen(process.env.SERVER_PORT, "0.0.0.0", () => console.log(Server is running on port: ${process.env.SERVER_PORT}));
Brody
Brody•10mo ago
you need to listen on the PORT variable instead
ZannaKonda
ZannaKondaOP•10mo ago
ahn it is an automated var from railway?
Brody
Brody•10mo ago
correct
ZannaKonda
ZannaKondaOP•10mo ago
oh now it make sense thanks bud testing now you are Amazing💯 seems working 200
Brody
Brody•10mo ago
happy to help!
Want results from more Discord servers?
Add your server