Skip to main content

Websocket protocol

Project description


WebSocket server based on aiohttp.


Using python package

pip install adsocket

How it works

To start the very basic server, this command will do:


assuming that you have redis server started on localhost listening on port 6379.

Now you should be able to connect to server on ws://localhost:5000

Basic usage

Adsocket should work out of the box, however it's probably not what you would expect. To customize adsocket you can create custom channels, authentication or commands.

Example of setting file

from adsocket.conf.default_settings import *  # NOQA

    'global': {
        'driver': 'my_package.channels.GlobalChannel',
        'create_on_startup': True,
    'user': {
        'driver': 'my_package.channels.MyUserChannel',
        'create_on_startup': False,



To apply changes to adsocket you need to export environment variable with path to settings

export ADSOCKET_SETTINGS=my_package.settings

Sending messages from you application

See adsocket-transport.




Out motivation to behind is follows:

  • High scalability
  • High performance
  • Easy customization
  • Easy extendability


All communication between server and client is through channels. Any client (understand websocket connection) can be member of n channels. There is no automatic subscription to channel so in order ot receive messages from server client have to subscribe to channels he or she wants to receive messages from or publish messages to.

Custom channels




Custom command


Project details

Download files

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

Files for adsocket, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size adsocket-0.1.2-py3-none-any.whl (22.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size adsocket-0.1.2.tar.gz (16.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page