R
Railway13mo ago
kenluzu

Error websocket failed

Project id: 1fafe6a1-f35c-475f-9af2-41dfaac1822a I have the message error 'Websocket connection to [domains's railway] failed.' My backend (spring boot) has normal endpoints http and expose just 1 topic for launch a notification. All in one service. Should I separate it? :/ In my front (angular) i try to connect in this way. this.stompClient = Stomp.over(function() { return new WebSocket("wss://biolaboratorio.up.railway.app/websocket") }) Does it have something to do with the port due to using 'wss'? or something else like the domain ¿?
7 Replies
Percy
Percy13mo ago
Project ID: 1fafe6a1-f35c-475f-9af2-41dfaac1822a
Fragly
Fragly13mo ago
Could be the PORT, are you sure you're listening to the PORT railway provides ( or did you set your own port in railway's service variable ) ?
kenluzu
kenluzuOP13mo ago
I see Tomcat server set the port 5900 by default. As variables I only have database params in my service
Fragly
Fragly13mo ago
You can only expose a specific port in railway you can access which port railway exposed for your service through the environment variable PORT You need to be listening to that port
kenluzu
kenluzuOP13mo ago
So i should set variable PORT, but in my connection to websocket i don' t change something?
Fragly
Fragly13mo ago
the url you're using to connect to your service seems fine
kenluzu
kenluzuOP13mo ago
I'll try it, thanks
Want results from more Discord servers?
Add your server