n1ckdm / websocket-broadcasting

Simple example showing how to broadcast to websockets using rabbitmq and aio-pika on FastAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Websocket Broadcasting with FastAPI

Simple example showing how to broadcast to websockets using rabbitmq and aio-pika on FastAPI

Usage

Bring the containers up with:

docker-compose up -d --build

Open up three internet browesers and navigate each one to the following addresses

  1. http://localhost
  2. http://localhost
  3. http://localhost/docs

You should have something that looks like this:

Open these windows

Click the button in windows (1) and (2) and then window (3), expand down the "push" endpoint, click "Try It", enter a message and click execute. All being well, you should see the message appear in both windows! 😃 🚀

About

Simple example showing how to broadcast to websockets using rabbitmq and aio-pika on FastAPI


Languages

Language:Python 100.0%