Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.52 KB

File metadata and controls

26 lines (19 loc) · 1.52 KB

API

All endpoints return JSON and are intended for the local dashboard or a protected internal integration.

Endpoint Description
GET /api/stats Current device count, accumulated traffic, alert count, and current byte-per-second rates.
GET /api/devices Devices visible in the latest completed ARP scan, keyed by MAC address.
GET /api/alerts Most recent alerts, oldest first.
GET /api/traffic Most recently active local IPs with accumulated upload/download bytes.
GET /api/packets Recent packet metadata, filterable by ip, protocol, direction, port, and limit.
GET /api/packets/summary Counts of retained packets grouped by protocol and direction.

/api/stats includes devices_count, total_traffic_bytes, alerts_count, current_upload_bps, current_download_bps, current_total_bps, and timestamp.

Socket.IO events

Event Payload
device_update Current device snapshot, keyed by MAC address.
traffic_update { ip, upload, download, unique_connections, timestamp } for one local IP since the last flush.
alert A display-ready string such as [PORT_SCAN] 192.168.1.10 contacted 20 TCP ports on 192.168.1.1 in 60s.

Traffic values are bytes. Current rates in /api/stats are bytes per second.

Packet inspection retains metadata only: timestamp, source/destination IP and port, protocol, packet size, direction, and TCP flags. Packet payloads are never returned or stored. limit is capped by MAX_PACKET_HISTORY.