Connect fastapi with python-socketio example
Example how to connect fastapi with python-socketio
- Python 3.11 (tested in python 3.11)
- pip or poetry
- Message queue (redis. kafka, rabbitmq) (not required but recommended for production)
- Create virtual env python -m venv env and activate it source env/bin/activate
- install depedency pip install -r requirements.txt
- Edit core/socket_io.py based on message_queue configuration
(if you don't want use any message queue just comment line 5)
- run the server uvicorn main:app
- on browser open http://localhost:8000/static/index.html
- install depedency poetry install
- Edit core/socket_io.py based on message_queue configuration
(if you don't want use any message queue just comment line 5)
- run the server poetry run uvicorn main:app
- on browser open http://localhost:8000/static/index.html
- https://www.reddit.com/r/FastAPI/comments/neds9c/integrate_socketio_with_fastapi/
- fastapi/fastapi#129