Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 1.21 KB

File metadata and controls

16 lines (12 loc) · 1.21 KB

ws source — open a WebSocket and stream each incoming text frame as an event. No shell, no polling: the server pushes, you get notified.

Monitor({ ws: {url: 'wss://events.example.com/stream', protocols: ['v1']}, description: 'deploy events', })

Each text frame becomes one notification (multiline frames stay as one event). Binary frames are reported as [binary frame, N bytes] rather than passed through. Socket close ends the watch with the close code surfaced; errors are surfaced before close. Same rate limiting as bash — a firehose will be suppressed and eventually stopped, so subscribe to a filtered feed where one exists.

Prefer this over command: 'websocat wss://…' — it avoids the extra process and line-buffering pitfalls. Use bash when you need to transform or filter frames with shell tools before they become events.