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 itsource 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