Streams

Subscribe to scan progress over a WebSocket with the efflux.v1 subprotocol.

What a stream is

Streams are WebSockets. They push scan progress instead of making you poll GET /scans/{job_id}.

URLEvents
wss://api.efflux.io/v3/stream/scansScan jobs for this key
wss://api.efflux.io/v3/stream/scans/{job_id}One job
wss://api.efflux.io/v3/stream/statusStream health
GET/v3/stream/scans

Scan event stream

GET/v3/stream/scans/{job_id}

One job

GET/v3/stream/status

Stream 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}"