Skip to content

BimaAdi/fastapi-with-python-socketio-example

Repository files navigation

Connect fastapi with python-socketio example

Example how to connect fastapi with python-socketio

Requirements

  • Python 3.11 (tested in python 3.11)
  • pip or poetry
  • Message queue (redis. kafka, rabbitmq) (not required but recommended for production)

Instalation using pip

  1. Create virtual env python -m venv env and activate it source env/bin/activate
  2. install depedency pip install -r requirements.txt
  3. Edit core/socket_io.py based on message_queue configuration (if you don't want use any message queue just comment line 5)
  4. run the server uvicorn main:app
  5. on browser open http://localhost:8000/static/index.html

Instalation using poetry

  1. install depedency poetry install
  2. Edit core/socket_io.py based on message_queue configuration (if you don't want use any message queue just comment line 5)
  3. run the server poetry run uvicorn main:app
  4. on browser open http://localhost:8000/static/index.html

References

  1. https://www.reddit.com/r/FastAPI/comments/neds9c/integrate_socketio_with_fastapi/
  2. fastapi/fastapi#129

About

Example how to connect fastapi with python-socketio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy