Simple async websocket server, using redis as broker.
$ git clone https://github.com/AHAPX/websocket
$ cd websocket
$ pip install -r requirements.txt
$ python websocket.py -c ~/websocket.cfg
Config has ini format, i.e.
[main]
host = localhost
port = 9998
debug = false
[redis]
host = localhost
port = 6379
db = 1
channel = ws-channel
$ python -m unittest
Websocket server subscribes to channel and wait messages. Message must be valid JSON. It should consist keys:
Send "ping" and you will receive "pong", if connection is ok
When connection is established client should send its tags, i.e.
{
"tags": ["tag1", "tag2"],
}
After that if server sends message to tag1, your client will receive it.
Content type
Image
Digest
Size
31.5 MB
Last updated
about 10 years ago
docker pull anarchy/websocket