How xmorox/netpix works
Netpix captures or loads packet data, parses network protocols, and serves it to a browser-based analysis and visualization client. The primary workflow is CLI source selection → packet capture/log ingestion → WebSocket delivery → client stream analysis, filtering, tables, and plots. The tree and excerpts establish the server and capture links; several client and protocol internals are indexed but unsampled, so their detailed wiring is not asserted.
Main entry points: app.rs Analysis app · packet.rs Packet model · sniffer.rs Packet sources · handler.rs Message handlers
Components 23
Capture and ingestion
- CLI commands
src/main.rs - Run command
src/cmd/run.rs - Packet sources
src/sniffer.rs
Server delivery
- WebSocket server
src/server.rs - Message handlers
src/server/handler.rs - Client sessions
src/server/client.rs
Protocol parsing
- RTC log parser
log_parser/src/parser.rs - MPEG-TS parsing
common/src/mpegts.rs - PSI tables
common/src/mpegts/psi.rs - PAT sections
common/src/mpegts/psi/pat/fragmentary_pat.rs - PMT sections
common/src/mpegts/psi/pmt/fragmentary_pmt.rs - RTP parsing
common/src/rtp.rs - RTCP parsing
common/src/rtcp/mod.rs - STUN parsing
common/src/stun.rs
Analysis client
- Browser entry
client/src/main.rs - Analysis app
client/src/app.rs - Stream analysis
client/src/streams.rs - Filter system
client/src/filter_system/parser.rs - Packet tables
client/src/app/tables.rs - Stream plots
client/src/app/plots/rtp_streams_plot.rs
Shared data
- Packet model
common/src/packet.rs
Other components
- Operator
- Analyst
Connections 25
- Operator → CLI commands: runs
src/main.rs - CLI commands → Run command: dispatches
src/main.rs - Run command → Packet sources: starts capture
src/cmd/run.rs - Run command → WebSocket server: starts server
src/cmd/run.rs - Packet sources → Packet model: builds packets
src/sniffer.rs - Packet sources → RTC log parser: reads RTC logs
src/sniffer.rs - WebSocket server → Message handlers: configures routes
src/server.rs - WebSocket server → Client sessions: initializes sessions
src/server.rs - Client sessions → Message handlers: handles messages
src/server/client.rs - Message handlers → Packet sources: reads packets
src/server/handler.rs - Message handlers → Client sessions: updates queues
src/server/handler.rs - Browser entry → Analysis app: starts app
client/src/main.rs - Analysis app → Stream analysis: uses streams
client/src/app.rs - Analysis app → Packet tables: provides tables
client/src/app.rs - Analysis app → Stream plots: provides plots
client/src/app.rs - Stream plots → Stream analysis: uses packet streams
client/src/app/plots/rtp_streams_plot.rs - Analysis app → Filter system: uses filtering
client/src/app.rs - Analyst → Browser entry: opens client
- MPEG-TS parsing → PSI tables: parses PSI
- PSI tables → PAT sections: assembles PAT
common/src/mpegts/psi/pat/fragmentary_pat.rs - PSI tables → PMT sections: assembles PMT
common/src/mpegts/psi/pmt/fragmentary_pmt.rs - Packet model → MPEG-TS parsing: supports parsing
- Packet model → RTP parsing: supports parsing
- Packet model → RTCP parsing: supports parsing
- Packet model → STUN parsing: supports parsing