llacroix / wsapp

Scalable WebSocket Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues


Logo

WSApp

Scalable WebSocket Application
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

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.

(back to top)

Built With

  • AioHTTP

(back to top)

Installation

  1. Clone the repo
    git clone https://github.com/llacroix/wsapp.git
  2. Install it with pip
    cd wsapp/
    pip install -e .
    

(back to top)

Usage

Check the examples/ folder for examples.

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Loïc Faure-Lacroix - @llacroix - lamerstar@gmail.com

Project Link: https://github.com/llacroix/wsapp

(back to top)

About

Scalable WebSocket Application


Languages

Language:Python 100.0%