Skip to main content

socker - pubsub websocket proxy server built on asyncio

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.

Releasing a new version to PyPi

  1. Bump the version in VERSION.

  2. Commit the change and tag it with the new version identifier.

  3. Build a source distribution: python setup.py sdist.

  4. Build a wheel: python setup.py bdist_wheel.

  5. Upload the built distribution using Twine: twine upload dist/*.

Thanks

Thanks to

for their brilliant asyncio packages.

Metadata

Release files for socker 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for socker 2.1.0
File Size Uploaded Provenance Actions
socker-2.1.0.tar.gz 10.7 kB Without provenance Details for socker-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for socker 2.1.0
File Interpreter ABI Platform Actions
socker-2.1.0-py3-none-any.whl Python 3 none any Details for socker-2.1.0-py3-none-any.whl

Total release size: 22.5 kB

Release files / socker-2.1.0.tar.gz

Download URL socker-2.1.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
16e8a905e6c1bd016195a34dc0c9aa0fce5b774edbb246d5f2a05a4172a17053
BLAKE2b-256 checksum
How to use checksums
afda85c55598100753693805bac2ead5644b112b7a5b07e361cc71afbead0814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / socker-2.1.0-py3-none-any.whl

Download URL socker-2.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
185810ccef924890bfa9ee8c24a88fc19e5751b4c27ddf3746e2e1e62830954c
BLAKE2b-256 checksum
How to use checksums
070eb6833beea974485099d9ff645e52d425ed080eb6a512f248d001be058c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for socker 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page