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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file socker-1.1.1.tar.gz
.
File metadata
- Download URL: socker-1.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0edecb85e406d60b99b62d4a12e1bd0f3c83ca6d167e0a5a0218f8dd62752fd9 |
|
MD5 | 13c7ff45865a3678c7aecaef74a1a176 |
|
BLAKE2b-256 | 0da9629092c4a2975c49ca4ec722f95419f35fd1d6b3e406365d5706298d5862 |
File details
Details for the file socker-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: socker-1.1.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9be90a99d8345a32bc5fec6b56bf8424d0c0d5d0032247a33d7a9ebd14a345f2 |
|
MD5 | 73e09ed45fa20349813cd0a6cb8936db |
|
BLAKE2b-256 | 919a7b8e13279d871ba9599f00921a0ef00504cfd806bd67dd19d348937e22f5 |