Websocket Connection to Serverless Failing

Hello. I'm updating a project to use websockets (moving from batch to realtime processing), however whenever I attempt to connect, I get a "websockets.exceptions.InvalidStatus: server rejected WebSocket connection: HTTP 404" error via wss://. It changes to a "HTTP 301" which redirects to https:// and also fails due to the invalid protocol if I use ws:// instead. I construct the URL as wss://<pod_id>-<port>.proxy.runpod.net/ws and expect this to be translated to wss://localhost:<port>/ws, and the websocket server is run in a thread just before the HTTP server is run. The latter works fine as I am able to communicate with it via the regular https://api.runpod.ai/v2/<pod_id> URL. The expected port is exposed in the Docker config, as per https://docs.runpod.io/pods/configuration/expose-ports. Any ideas what the issue is?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?