Table of Contents
WSApp is a library that may helps making scalable websocket application by abstracting the websocket out of your application. It is highly inspired by AWS GatewayAPI for WebSocket application.
What this projects attempt to solve is to remove the websocket states from your application. A simple implementation of websockets binds the websocket server to the http endpoint. In other words, the application server becomes a manager of connection, websocket message dispatching etc.
The downside of this architecture is that it's not scalable. Since the software expect to receive all connections on a single process. It means that if you had multiple websocket servers, the connections on one instance wouldn't be able to communicate with the connections of an other instance.
This library helps you design a websocket service that can be scaled and can dispatch request in a multi process environment. The API of the connection manager would abstract the complexity behind inter instance communication.
Currently, it's only possible to run it in a single process environment. But implementation with a multi process environment is planned as it's the whole point of this project. It's just that the simple implementation is simpler to implement obviously. What's important is that while this library will handle certain use cases. It is developped in mind that it would be integrated in an application instead of having an application integrated into wsapp. It is expected that the interfaces can be implemented to suit your needs.
- Clone the repo
git clone https://github.com/llacroix/wsapp.git
- Install it with pip
cd wsapp/ pip install -e .
Check the examples/ folder for examples.
- Add simple local managers and aiohttp integration
- Added examples of a clustered websocket integration with 1 connections service
- Add handler manager with http backend
- Make scalable integration
- Add a connection manager service with customizable backend
- Add integration with the remote connection manager service
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Loïc Faure-Lacroix - @llacroix - lamerstar@gmail.com
Project Link: https://github.com/llacroix/wsapp