Bounce-WS
Overview
This project is a WebSocket-based framework built with FastAPI and Uvicorn, designed to facilitate real-time communication between the frontend and backend.
Features
- Real-time WebSocket communication.
- Multi-threaded server for efficient handling of connections.
- Scalable and modular design for easy integration.
- Prebuilt logic for messages
Installation
To install the project, clone the repository and install the required dependencies:
git clone https://github.com/Allorak/bounce-ws
cd websocket-api
pip install -r requirements.txt
Alternatively you can use pip to install:
pip install https://github.com/Allorak/bounce-ws
Or install from PyPI index:
pip install bounce-ws
Core ideas
The main idea is that client and server use websockets for message exchange with specified message structure:
{
"event": "<event name>",
"data": "<message payload>",
"timestamp": "<iso formated send time timestamp without offset>"
}
For interacting with the server clients firstly have to subscribe to the needed events sending following message:
{
"event": "subscribe",
"data": {
"events": [<list of event names to subscribe to>]
},
"timestamp": "<iso formated send time timestamp without offset>"
}
You may specify "*" in "events" key to subscribe to all events, provided by the server
In a similar way client may unsubscribe from the specified events:
{
"event": "unsubscribe",
"data": {
"events": [<list of event names to unsubscribe from>]
},
"timestamp": "<iso formated send time timestamp without offset>"
}
Framework provides following options for message exchange:
- Clients can subscribe to the needed events and unsubscribe from them
- Send message using AbstractSender calling "send" method manually
- Send message using TimedAbstractSender calling "send" method repeatedly
- Handle incoming messages with AbstractHandler, discarding messages of the same event with timestamp larger than last handled
Example
Usage examples can be found in examples/ folder
Metadata
Release files for bounce-ws 0.9.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bounce_ws-0.9.9.tar.gz | 10.8 kB | Without provenance | Details for bounce_ws-0.9.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bounce_ws-0.9.9-py3-none-any.whl | Python 3 | none | any | Details for bounce_ws-0.9.9-py3-none-any.whl |
Total release size: 23.6 kB
Release files / bounce_ws-0.9.9.tar.gz
| Download URL | bounce_ws-0.9.9.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c28fb7cfeb6e938360eb1d6e981356a4dc4788a54113192383dbdcc13e7d8664
|
|
BLAKE2b-256 checksum How to use checksums |
52ade45d4f4aded342b1f681f66f71e988f30cd238895f1c50483634112cd123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Release files / bounce_ws-0.9.9-py3-none-any.whl
| Download URL | bounce_ws-0.9.9-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e9af959f7f1782116ca2aa1c07594dddc66bc235bd1225ca6f75ab4762c730d
|
|
BLAKE2b-256 checksum How to use checksums |
f1778d7da12cf2f61f8f11faf6987f630f9b4ed3d541247eb3b981cad45df072
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Security for bounce-ws 0.9.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.