Skip to main content

Websocket protocol

Project description

ADSocket

WebSocket server based on aiohttp.

Install

Using python package

pip install adsocket

How it works

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

adsocket

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

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

AUTHENTICATION_CLASSES = (
    'sraps_socket.auth.SrapsAuth',
)

DISCONNECT_UNAUTHENTICATED = 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.

Documentation

@Todo

Goals

Out motivation to behind is follows:

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

Channels

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

@Todo

Commands

@Todo

Custom command

@Todo

Project details


Download files

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

Source Distribution

adsocket-0.1.0.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adsocket-0.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file adsocket-0.1.0.tar.gz.

File metadata

  • Download URL: adsocket-0.1.0.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for adsocket-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7e63fc46d2d2128be1eea0acec321417c0ff7f36312a06458c0c574712bb6327
MD5 7a31f046643560eecab42b0bc3d86c2d
BLAKE2b-256 f3b8a9f4b4e389fb339b57467d1d885bd6eda48a0b6e4f887bc0ce78360574cb

See more details on using hashes here.

File details

Details for the file adsocket-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: adsocket-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for adsocket-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef0034af2088cf5f8bef740f777d3b409717efc67b03ef9bb1fa77cd3caceefb
MD5 2c962bea9432de28aae6e2f5de0f6a80
BLAKE2b-256 4216235816eccab5cd7b3062fe1d02b298f9366c4e0c0462dea8e8dbc5550df7

See more details on using hashes here.

Supported by

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