Signal Trace is a browser-based WebSocket traffic inspector for real-time IoT debugging. It helps you connect to raw WebSocket or Socket.IO endpoints, inspect inbound and outbound frames, validate outgoing JSON against a lightweight schema, and replay or export captured traffic.
- React 19
- TypeScript
- Vite
- Vitest
- Aegis Design System
- Live connect and disconnect workflow for WebSocket endpoints
- Protocol decode modes:
auto,raw, andsocketio - Socket.IO handshake support with configurable path, namespace, auth JSON, and event name
- Timeline inspection with direction, namespace, event, payload, byte size, and latency
- Search and namespace filtering for narrowing noisy traffic
- Outbound payload helpers for JSON formatting and auto-refreshing
id/timestamp - Schema Guard modal for validating outgoing JSON before send
- Timeline import and export in
JSONandNDJSON - Replay controls with adjustable playback speed
- Demo mode for synthetic traffic generation without a backend
- Theme toggle in the app shell
- Node.js 20+
- npm 10+
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the local URL printed by Vite, usually
http://localhost:5173.
npm run dev- start the Vite dev servernpm run typecheck- run the TypeScript project build without bundlingnpm run build- run type-checking and build production assetsnpm run preview- preview the production build locallynpm run lint- run ESLintnpm run lint:fix- run ESLint with fixesnpm run test- run Vitest in watch modenpm run test:run- run the full test suite once
- Enter a WebSocket endpoint such as
ws://localhost:8080. - Choose a protocol decode mode. Start with
autounless you know the framing. - Click
Connect. - Inspect incoming and outgoing traffic in the timeline.
- Use search and namespace filters to isolate the frames you care about.
- Open
Schema Builderif you want to validate outgoing JSON before sending. - Use replay, import, and export controls from the timeline toolbar as needed.
- The transmit panel defaults to the
/telemetrynamespace and a JSON payload. Format JSONprettifies valid JSON and emits a system event if the payload is invalid.Auto-refresh id/timestampupdates those fields before send when they already exist in the payload.- If no correlation id is present, Signal Trace injects a
requestIdautomatically before sending.
If your backend uses Socket.IO namespaces or auth:
- Enable
Socket.IO Handshake. - Set
Socket.IO Path, typically/socket.io. - Set
Socket.IO Namespace, for example/devices. - Provide
Socket.IO Auth JSONwhen your server expects auth in the namespace connect payload. - Switch protocol mode to
socketiofor outbound event frames. - Optionally set
Socket.IO Event; the default event name istrace. - Signal Trace waits for namespace readiness before allowing Socket.IO sends.
- Engine.IO ping frames (
2) are answered automatically with pong (3).
- Open the schema builder from the transmit panel.
- Add fields with type
string,number,boolean,object, orarray. - Mark fields as required when needed.
- Leave the schema empty to disable validation.
- Schema parse or validation failures are written to the system timeline instead of being swallowed.
- Export captured traffic as formatted
JSONor line-delimitedNDJSON. - Import previously captured files in either format.
- Invalid or empty imports produce a system event instead of silently failing.
- Replay replays imported or captured messages in timestamp order with adjustable speed.
- Demo mode stops replay before starting synthetic traffic.
Signal Trace uses Vitest with Testing Library and @testing-library/jest-dom.
Run the full test suite once:
npm run test:runRun tests in watch mode:
npm run testCoverage is organized around the current source layout:
src/lib/*.test.tsfor pure utility helperssrc/hooks/*.test.tsfor hook behavior viarenderHooksrc/components/*.test.tsxfor component rendering and user flowssrc/App.test.tsxfor integration coverage across hooks and UI
src/
App.tsx # Thin orchestrator for hooks and top-level actions
App.test.tsx # Integration tests
types.ts # Shared domain types
main.tsx
styles.css
hooks/
useTimeline.ts # Timeline state, demo mode, replay, import/export
useTimeline.test.ts
useConnection.ts # WebSocket lifecycle, Socket.IO handshake, RTT tracking
useConnection.test.ts
useSchemaGuard.ts # Schema builder state and parsed schema
useSchemaGuard.test.ts
components/
ConnectionPanel.tsx
ConnectionPanel.test.tsx
MessageRow.tsx
MessageRow.test.tsx
NamespaceFilter.tsx
NamespaceFilter.test.tsx
SchemaGuardModal.tsx
SchemaGuardModal.test.tsx
TimelinePanel.tsx
TimelinePanel.test.tsx
TransmitPanel.tsx
TransmitPanel.test.tsx
lib/
socketio-utils.ts
socketio-utils.test.ts
trace-utils.ts
trace-utils.test.ts
vitest.setup.ts
vite.config.ts
package.json
AGENTS.md
- Type check:
npm run typecheck - Build check:
npm run build - Test check:
npm run test:run
- Use Demo mode when the target endpoint is unavailable and you still want to exercise the UI.
- Imported traffic and incoming frames are treated as untrusted input and normalized before use.