Skip to main content

redis pubsub websocket proxy

Project description

socker runs as a single-process service, using asyncio for non-blocking I/O.

socker uses a single redis pubsub channel, and has its own channel subscription logic, this means that you may share redis database with other applications.

socker runs as a single-process service. socker opens up a websocket server port and establishes a redis connection. The redis connection creates a subscription on the socker channel.

Installation

pip install socker

Usage

$ socker -h
Start the socker websocket server

Usage:
  socker [options]
  socker -? | --help
  socker --version

Options:
  -i INTERFACE    Listening interface [default: localhost]
  -p PORT         Listening port [default: 8765]

  -v              Enable verbose output

  --redis-host=HOST             Redis host [default: localhost]
  --redis-port=PORT             Redis port [default: 6379]
  --redis-db=DB                 Redis database [default: 0]
  --redis-password=PASSWORD     Redis password

  --logto FILE    Log output to FILE instead of console

  --version       show version
  -? --help       Show this screen

To publish a message to socker from another application:

from socker import Message


channel = 'foo.bar.42'
data = {
    'yes': [
        'yes',
        'no',
        'baz'
    ]
}

redis_client.publish('socker', Message(channel, data))

Any websocket clients subscribed to

  • foo.*

  • foo.bar.*

  • foo.bar.42

will receive that message.

Thanks

Thanks to

for their brilliant asyncio packages.

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

socker-2.0b2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

socker-2.0b2-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file socker-2.0b2.tar.gz.

File metadata

  • Download URL: socker-2.0b2.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for socker-2.0b2.tar.gz
Algorithm Hash digest
SHA256 2662d27d01141feb376ac55aac5ba05860584579efcbf6b4fd1fb8b538172925
MD5 9191d40178e9d28f976b45006fb2cb71
BLAKE2b-256 d9cc025e10ebe0dda15ef646d1bc45759d91436e6230c446bd5e5f178d8e6ec3

See more details on using hashes here.

File details

Details for the file socker-2.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for socker-2.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1bd5f62752092fd576fdd23f39d029545c17b7b6916b65acd6ccf17b4f681b
MD5 7f9063867b47f6f189d86b930b0e1730
BLAKE2b-256 26282f4c4002f1c8aecfaf796485bc1d00a08440af198374008b03c7beb85dba

See more details on using hashes here.

Supported by

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