Flask App + Websocket Server Complications

swedanielraskin
FREE

15 days ago

Hi there,
I'm running a flask app on port 5000 and a websocket server on port 8080. I'm running into issues with exposing both ports. I find that if I set the railway subdomain to port 5000, the flask app works but connecting to the websocket gives me this (Telnyx) error:

ERROR:app: Failed to start streaming for call v3:OIsW2ZYahZ8RR3TaqtA5dvPm-JFN6DEdnlVXhg_yzn0UNr1VOHbt-w: 422, {
"errors": [
{
"code": "90046",
"title": "Media Streaming failed",
"detail": "Failed to connect to destination"
}
]
}

Essentially the issue is a matter of exposing multiple ports. I tried setting the websocket server to point to a TCP Proxy link, but it gave the same effect. Assumingly because Telnyx couldn't connect to the proxy link and was falling back to the subdomain that points to port 5000.
What's the issue here? Can I utilize the TCP Proxy setting, or would you recommend I buy and set a custom domain? (So subdomain --> 5000, custom domain -> 8080)

$10 Bounty

2 Replies

15 days ago

Hello,

You would need a custom domain so that you can expose both ports on the custom domain.

https://docs.railway.com/guides/public-networking#target-ports


Status changed to Awaiting User Response Railway 15 days ago


15 days ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 15 days ago


Status changed to Solved swedanielraskin 15 days ago


Status changed to Open chandrika 15 days ago


smolpaw
HOBBYTop 5% Contributor

14 days ago

why was this opened again ?
Brody answered the question. Use a custom domain swedanielraskin.