coderClaw

Bonjour / mDNS discovery

CoderClaw uses Bonjour (mDNS / DNS‑SD) as a LAN‑only convenience to discover an active Gateway (WebSocket endpoint). It is best‑effort and does not replace SSH or Tailnet-based connectivity.

Wide‑area Bonjour (Unicast DNS‑SD) over Tailscale

If the node and gateway are on different networks, multicast mDNS won’t cross the boundary. You can keep the same discovery UX by switching to unicast DNS‑SD (“Wide‑Area Bonjour”) over Tailscale.

High‑level steps:

  1. Run a DNS server on the gateway host (reachable over Tailnet).
  2. Publish DNS‑SD records for _coderclaw-gw._tcp under a dedicated zone (example: coderclaw.internal.).
  3. Configure Tailscale split DNS so your chosen domain resolves via that DNS server for clients (including iOS).

CoderClaw supports any discovery domain; coderclaw.internal. is just an example. iOS/Android nodes browse both local. and your configured wide‑area domain.

{
  gateway: { bind: "tailnet" }, // tailnet-only (recommended)
  discovery: { wideArea: { enabled: true } }, // enables wide-area DNS-SD publishing
}

One‑time DNS server setup (gateway host)

coderclaw dns setup --apply

This installs CoreDNS and configures it to:

Validate from a tailnet‑connected machine:

dns-sd -B _coderclaw-gw._tcp coderclaw.internal.
dig @<TAILNET_IPV4> -p 53 _coderclaw-gw._tcp.coderclaw.internal PTR +short

Tailscale DNS settings

In the Tailscale admin console:

Once clients accept tailnet DNS, iOS nodes can browse _coderclaw-gw._tcp in your discovery domain without multicast.

The Gateway WS port (default 18789) binds to loopback by default. For LAN/tailnet access, bind explicitly and keep auth enabled.

For tailnet‑only setups:

What advertises

Only the Gateway advertises _coderclaw-gw._tcp.

Service types

TXT keys (non‑secret hints)

The Gateway advertises small non‑secret hints to make UI flows convenient:

Security notes:

Debugging on macOS

Useful built‑in tools:

If browsing works but resolving fails, you’re usually hitting a LAN policy or mDNS resolver issue.

Debugging in Gateway logs

The Gateway writes a rolling log file (printed on startup as gateway log file: ...). Look for bonjour: lines, especially:

Debugging on iOS node

The iOS node uses NWBrowser to discover _coderclaw-gw._tcp.

To capture logs:

The log includes browser state transitions and result‑set changes.

Common failure modes

Escaped instance names (\032)

Bonjour/DNS‑SD often escapes bytes in service instance names as decimal \DDD sequences (e.g. spaces become \032).

Disabling / configuration