Skip to content

Add TCP push client for detection forwarding#37

Open
jonnyspicer wants to merge 1 commit into
mainfrom
feature/tcp-push-client
Open

Add TCP push client for detection forwarding#37
jonnyspicer wants to merge 1 commit into
mainfrom
feature/tcp-push-client

Conversation

@jonnyspicer
Copy link
Copy Markdown

Summary

  • Adds TCP push client to api/server.js that forwards detection frames to a remote tracker-host over persistent TCP connections
  • Uses newline-delimited JSON framing with node_id and token in every frame
  • Ring buffer (configurable buffer_max, default 1000) stores frames during disconnects, drains on reconnect
  • Heartbeat keepalives every 10 seconds during idle periods
  • TCP_NODELAY for low-latency forwarding
  • Automatic reconnection with backoff on connection loss
  • New config fields: network.tracker_forward.token, buffer_max, heartbeat_interval_sec

Test plan

  • Tested locally with tracker-host TCP server and node simulator
  • Deploy to a single test node first (Phase 2 of rollout)
  • Run in dual-mode alongside HTTP polling to compare data streams
  • Monitor reconnect behavior, buffer drain, heartbeat keepalives

🤖 Generated with Claude Code

Forward detection frames to a remote tracker-host over persistent TCP
connections with newline-delimited JSON framing, token authentication,
ring buffer for offline periods, heartbeat keepalives, and automatic
reconnection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant