Add LAN service discovery via UDP multicast #7

Merged
razvandimescu merged 6 commits from feat/lan-discovery into main 2026-03-22 14:03:32 +08:00
razvandimescu commented 2026-03-21 22:58:15 +08:00 (Migrated from github.com)

Summary

  • LAN service discovery: Numa instances on the same network automatically find each other's services via UDP multicast (239.255.70.78:5390)
  • DNS + proxy integration: .numa queries and HTTP proxy fall through to LAN peers when no local match exists
  • Instance-based self-filter: Uses per-process instance ID instead of IP-based filtering, enabling multiple instances on the same host
  • SO_REUSEPORT: Enables multicast port sharing on Unix for multi-instance setups
  • Multicast address validation: Rejects non-multicast IPs in config with a clear warning
  • LAN accessibility indicator: Dashboard shows green "LAN" or amber "local only" badge per service, probing whether the service is reachable from the network or bound to localhost
  • Unified TCP check: Single check_tcp() function for health and LAN reachability probes
  • Dashboard reorder: Local Services moved above Blocking for developer-first layout
  • README: LAN discovery docs with mesh diagram, hub mode setup, updated comparison table and roadmap
  • Demo script: Updated scene order for new dashboard layout, LAN badges visible after adding service
  • Version bump: 0.1.0 → 0.3.0 to match release cadence
  • Configurable: broadcast interval, peer timeout, multicast group/port — all via [lan] config section

Test plan

  • Two instances on same host with different configs (numa-a.toml, numa-b.toml)
  • Instance B discovers Instance A's web-app service via multicast
  • DNS resolution: dig @127.0.0.1 -p 15354 web-app.numa → peer LAN IP
  • HTTP proxy: curl through Instance B reaches Instance A's service
  • make all passes (fmt, clippy, audit, build)
  • Dashboard: verify LAN/local-only badges render correctly
  • Run scripts/record-demo.sh to re-record hero GIF
  • Two machines on same LAN (manual verification)

🤖 Generated with Claude Code

## Summary - **LAN service discovery**: Numa instances on the same network automatically find each other's services via UDP multicast (239.255.70.78:5390) - **DNS + proxy integration**: `.numa` queries and HTTP proxy fall through to LAN peers when no local match exists - **Instance-based self-filter**: Uses per-process instance ID instead of IP-based filtering, enabling multiple instances on the same host - **SO_REUSEPORT**: Enables multicast port sharing on Unix for multi-instance setups - **Multicast address validation**: Rejects non-multicast IPs in config with a clear warning - **LAN accessibility indicator**: Dashboard shows green "LAN" or amber "local only" badge per service, probing whether the service is reachable from the network or bound to localhost - **Unified TCP check**: Single `check_tcp()` function for health and LAN reachability probes - **Dashboard reorder**: Local Services moved above Blocking for developer-first layout - **README**: LAN discovery docs with mesh diagram, hub mode setup, updated comparison table and roadmap - **Demo script**: Updated scene order for new dashboard layout, LAN badges visible after adding service - **Version bump**: 0.1.0 → 0.3.0 to match release cadence - **Configurable**: broadcast interval, peer timeout, multicast group/port — all via `[lan]` config section ## Test plan - [x] Two instances on same host with different configs (`numa-a.toml`, `numa-b.toml`) - [x] Instance B discovers Instance A's `web-app` service via multicast - [x] DNS resolution: `dig @127.0.0.1 -p 15354 web-app.numa` → peer LAN IP - [x] HTTP proxy: `curl` through Instance B reaches Instance A's service - [x] `make all` passes (fmt, clippy, audit, build) - [x] Dashboard: verify LAN/local-only badges render correctly - [x] Run `scripts/record-demo.sh` to re-record hero GIF - [x] Two machines on same LAN (manual verification) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.