What a stream is
Streams are WebSockets. They push scan progress instead of making you poll GET /scans/{job_id}.
| URL | Events |
|---|---|
wss://api.efflux.io/v3/stream/scans | Scan jobs for this key |
wss://api.efflux.io/v3/stream/scans/{job_id} | One job |
wss://api.efflux.io/v3/stream/status | Stream health |
GET
/v3/stream/scansScan event stream
GET
/v3/stream/scans/{job_id}One job
GET
/v3/stream/statusStream status
Authentication
Do not send Authorization on the upgrade. Send the key in the WebSocket subprotocol:
Sec-WebSocket-Protocol: efflux.v1, <token>efflux.v1 is required. The token is the same API key you would put in Authorization on an HTTP call.
websocat -t \
'wss://api.efflux.io/v3/stream/scans' \
-H="Sec-WebSocket-Protocol: efflux.v1, ${EFFLUX_TOKEN}"For one scan, put the id in the path:
websocat -t \
"wss://api.efflux.io/v3/stream/scans/${JOB_ID}" \
-H="Sec-WebSocket-Protocol: efflux.v1, ${EFFLUX_TOKEN}"