I have a Python backend deployed to Render. It is built with FastAPI. I recently tried to add a websocket endpoint to the server. I got it working locally, but when I deployed to Render, I couldn’t connect to the endpoint.
Originally, the client was simply connecting via an unencrypted
ws:// connection. Makes sense that render wouldn’t like that. But the response was weird. Render responds to that connection with a redirect telling the client to connect to the same path but using
https://. I would have expected that the connection would be redirected to the encrypted websocket scheme
Is this redirect an issue on Render’s side? My server logs never indicate that they even received a connection when using the
ws:// scheme. And when I manually set
wss://, I strangely receive a 404.
I’m wondering if there isn’t some particular network settings stuff going on with the Python deployment. Will try deploying my service with Docker instead of Render’s native Python deployment and see how that goes. Seems like other comments have indicated that might be helpful.