Websocket Error
yangliuxin-nn
TRIALOP

a year ago

Hi team, we use railway as backend and vercel as frontend. We try to use websocket to show some messages in the UI. But the problem is in our local machine, we can successfully see the logs in the UI but when it comes to the deployed link, the log does not appear. Could you please help us with this problem? Thanks!

Solved

3 Replies

unicodeveloper
PRO

a year ago

Hi, are you binding the websocket server correctly to listen on the appropriate host and port? The app should bind to `0.0.0.0`


Status changed to Awaiting User Response Railway about 1 year ago


unicodeveloper

Hi, are you binding the websocket server correctly to listen on the appropriate host and port? The app should bind to `0.0.0.0`

emilyqian2001
TRIAL

a year ago

Yes, we seem to solve the problem by explicitly adding websockets==12.0 to requirements.text
we are using websocket from fastapi, and we already pip install fastapi==0.104.1, uvicorn==0.24.0

from fastapi import FastAPI, HTTPException, WebSocket

Is this actually the solution? Cause we can run the whole app locally without pip install websockets


Status changed to Awaiting Railway Response Railway about 1 year ago


unicodeveloper
PRO

a year ago

Websockets work on Railway. But sometimes we notice that users omit certain dependencies from their apps or set the port/network config wrong. So in your case, it seems that's needed to make it work from your app.


Status changed to Awaiting User Response Railway about 1 year ago


Railway
BOT

7 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 7 months ago


Loading...