Skip to main content

ChannelBox it is a simple tool for Starlette framework that allows you to make named webscoket channels.

Project description

ChannelBox

ChannelBox it is a simple tool for Starlette framework that allows you send messages to named websocket channels.

Example of use:

  • chats
  • notifications from backend
  • alerts
https://github.com/Sobolev5/channel-box

Install

To install run:

pip install channel-box

[important!] See full working example with websocket setup

https://channel-box.andrey-sobolev.ru/
https://github.com/Sobolev5/channel-box/tree/master/example

NGINX websocket setup

http://nginx.org/en/docs/http/websocket.html

Check uvicorn installation

pip install uvicorn[standard]

channel_box methods

Send message to any group from any part of your code:

await channel_box.channel_send("MySimpleChat", {"username": "another part code", "message": "hello from SendFromAnotherPartCode"}, show=True, history=True)

Show groups and channels:

await channel_box.channels_show()  

Flush all groups and channels:

await channel_box.channels_flush()

Buy me a coffee [thanks]

TPbvvhqZsEuKCLEAWMAERgw7f82eGeU389 TRC (TRON)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

channel_box-0.3.2-py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page