Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yaroslaff/hoocron-plugin-websocket
Websocket client plugin for Hoocron
https://github.com/yaroslaff/hoocron-plugin-websocket
Last synced: 5 days ago
JSON representation
Websocket client plugin for Hoocron
- Host: GitHub
- URL: https://github.com/yaroslaff/hoocron-plugin-websocket
- Owner: yaroslaff
- License: mit
- Created: 2022-01-27T13:29:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-27T22:10:51.000Z (almost 3 years ago)
- Last Synced: 2024-10-28T17:12:24.775Z (15 days ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hoocron-plugin-websocket
Websocket client plugin for Hoocron## Install
~~~
pip3 install hoocron-plugin-websocket
~~~## Usage
~~~
$ hoocron.py --ws TICK --wsroom myapps::u1 --wsurl http://localhost:8899/ --wssecret myapps-pass
...
started websocket thread, watch room 'myapps::u1' on http://localhost:8899/
Websocket connected to http://localhost:8899/run TICK from websocket
Tick! (uptime: 6 seconds)
Result(TICK): ticked
~~~## Server-side
### Redis
`SET ws-emit::secret::myapps myapps-pass`### ws-emit
`ws-emit.py -a 0.0.0.0:8899 --cors '*' --secret 123`### curl
`curl -d @/tmp/x.json -H "Content-Type: application/json" -X POST http://localhost:8899/emit`/tmp/x.json:
~~~
{
"event": "update",
"room": "myapps::u1",
"data": "TICK",
"namespace": null,
"secret": "123"
}
~~~# See also
- [hoocron: cron with hooks](https://github.com/yaroslaff/hoocron)
- [ws-emit: emit websocket messages from any source, even from CLI with curl](https://github.com/yaroslaff/ws-emit)