wsnotifier
wsnotifier is a lightweight gevent based asynchronous websocket Server written in Python. wsnotifier exposes HTTP APIs for forwarding the messages to the websocket clients. This makes it easier to use the service with any web application. It’s completely written in Python and doesn’t depend on external systems like Redis for storing/retrieving messages.
Installation
You can install using pip
$ pip install git+https://github.com/semk/wsnotifier.git
Or using docker
$ docker pull semk/wsnotifier
Running wsnotifier server
$ wsnotifier Starting wsnotifier on ws://0.0.0.0:1729/alerts and http://0.0.0.0:1729/alerts
Or using docker
$ docker run -p 1729:1729 --rm -it semk/wsnotifier Starting wsnotifier on ws://0.0.0.0:1729/alerts and http://0.0.0.0:1729/alerts
Connecting to wsnotifier via a websocket client
wscat is a nice commandline websocket client. You can install it by
$ npm install -g wscat
Connect to the websocket server at ws://0.0.0.0:1729/alerts
$ wscat -c ws://localhost:1729/alerts connected (press CTRL+C to quit)
Posting messages to wsnotifier for forwarding to websocket clients.
You can use any HTTP client to send the messages. This will be forwarded to all the connected websocket clients asynchronously. A Python client for wsnotifier is available here
$ curl -X POST -H "Content-Type: application/json" -d '{"id": "unique-message-id", "type": "important", "message": "important message"}' http://0.0.0.0:1729/alerts
{"status": "success"}
You can see the forwarded message appearing on the wscat client instantly.
$ wscat -c ws://localhost:1729/alerts
connected (press CTRL+C to quit)
< {"message": "important message", "type": "important", "id": "unique-message-id"}
>
Metadata
Release files for wsnotifier 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wsnotifier-1.0.4.tar.gz | 6.0 kB | Without provenance | Details for wsnotifier-1.0.4.tar.gz |
Release files / wsnotifier-1.0.4.tar.gz
| Download URL | wsnotifier-1.0.4.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ccd513a71e508337c6f6bd4b6850907d541f054bd59dcec146528d8ecdb145a
|
|
BLAKE2b-256 checksum How to use checksums |
56377d73763ba752f2a30aa13dcbe096db31ce35f48afc5efb4b72db0920f871
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wsnotifier 1.0.4
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.