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
Project ID:
1fafe6a1-f35c-475f-9af2-41dfaac1822a
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 ) ?
I see Tomcat server set the port 5900 by default.
As variables I only have database params in my service
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 portSo i should set variable PORT, but in my connection to websocket i don' t change something?
the url you're using to connect to your service seems fine
I'll try it, thanks