WebSocket and streaming
The WebSocket server streams analysis results, trace events and state changes to remote clients in real time using a binary FlatBuffers protocol.
Start the server
Section titled “Start the server”./tenet trace.bin --ws-port 9090Protocol
Section titled “Protocol”- Transport: WebSocket on the configured port.
- Schema: FlatBuffers (
.fbsdefinitions in the Tenet source). Binary encoding, no JSON parsing overhead. - Direction: Server pushes events; clients subscribe to topics.
Event topics
Section titled “Event topics”| Topic | Content |
|---|---|
timeline |
Instruction cursor movement, navigation events |
pass_state |
Pass state changes (started, progress, completed, failed) |
analysis_result |
Structured pass results as they complete |
register_update |
Register value changes at the current cursor |
memory_update |
Memory region changes |
breakpoint |
Breakpoint/watchpoint hit events |
Usage patterns
Section titled “Usage patterns”- Live dashboard: Build a web-based trace monitor that updates as analysis proceeds.
- Remote collaboration: Multiple clients connect to the same Tenet instance; all see the same cursor and results.
- CI integration: A CI job opens a trace, runs passes, streams results and exits.
- Custom visualization: Render CFG, taint graphs or memory heatmaps in a web UI using the streamed events.
Connection lifecycle
Section titled “Connection lifecycle”- Client connects to
ws://host:port. - Client subscribes to one or more topics.
- Server pushes events for subscribed topics.
- Client can also send JSON-RPC requests on the same connection for interactive queries.
- On disconnect, the server continues the session; the next client reconnects to the same state.
Limitations
Section titled “Limitations”- WebSocket streaming requires an active Tenet process; it is not an offline API.
- FlatBuffers schema stability is not guaranteed across versions; clients may need updates when upgrading Tenet.
- High-frequency events (e.g., timeline cursor at every instruction) may need client-side throttling or debouncing.