Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artyom/wspush
Service to deliver redis PUBSUB messages over websocket
https://github.com/artyom/wspush
pubsub websocket
Last synced: about 1 month ago
JSON representation
Service to deliver redis PUBSUB messages over websocket
- Host: GitHub
- URL: https://github.com/artyom/wspush
- Owner: artyom
- License: mit
- Created: 2018-04-18T14:42:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-27T14:05:35.000Z (6 months ago)
- Last Synced: 2024-06-27T17:04:16.535Z (6 months ago)
- Topics: pubsub, websocket
- Language: Go
- Size: 31.3 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE.txt
Awesome Lists containing this project
README
Command wspush implements http service relaying redis pubsub messages to
websocket connections or as server-sent events.wspush subscribes to redis channel(s) using "PSUBSCRIBE prefix*" command
where prefix can be set with -prefix flag. When it receives a message
published to "prefixFoo" channel, it looks up any connected client(s) with
query string parameter "token=Foo" and sends message to each client as a
single websocket binary frame.If client connects to path ending with /sse, or having "Accept:
text/event-stream" header, messages are delivered as server-sent events
(https://www.w3.org/TR/eventsource/), with default "message" event type. It
is expected that message published to redis is valid utf8 string.If program started with -hmac flag set to base64 encoded (url-compatible,
padless) secret key, this key is used to verify tokens, which then must be
base64 encoded (url-compatible, padless) values of payload concatenated with
its md5 HMAC signature. Alternatively, key value can also be passed with
WSPUSH_KEY environment variable.If wspush is started with -ping set to some arbitrary payload, that payload will
be sent as a heartbeat every 45 seconds. Otherwise, an empty ping will be sent
instead ("ping" message for server-sent events, or unsollicited "pong" frame for
websocket connections).