# FastAPI WebSocket returns HTTP 404 on Spaces

**URL:** <https://discuss.huggingface.co/t/fastapi-websocket-returns-http-404-on-spaces/159865>\
**Category:** Spaces\
**Created:** [June 19, 2025, 3:12am UTC](https://discuss.huggingface.co/t/fastapi-websocket-returns-http-404-on-spaces/159865 "2025-06-19T03:12:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 19, 2025, 7:18am UTC](https://discuss.huggingface.co/t/fastapi-websocket-returns-http-404-on-spaces/159865/2 "2025-06-19T07:18:41Z")

</div>

Perhaps this case?

> [@Chainlit WebSocket Issue on Hugging Face Spaces: Missing websockets in Requirements?](https://discuss.huggingface.co/t/chainlit-websocket-issue-on-hugging-face-spaces-missing-websockets-in-requirements/146755):
>
> I started using Hugging Face Spaces just a few hours ago and noticed that my simple Chainlit app wasn’t working correctly. The app itself is straightforward—it simply returns whatever the user inputs. However, it seems the WebSocket communication isn’t functioning properly, so the responses don’t display as expected (see attached image). After investigating, I found that specifying the websockets package in my requirements.txt file fixes the problem. With websockets installed, the res…

---

_[View the full topic](https://discuss.huggingface.co/t/fastapi-websocket-returns-http-404-on-spaces/159865)._
