mirror of
https://github.com/tailscale/tailscale.git
synced 2026-04-03 22:25:27 -04:00
Add an experimental mechanism for registering custom disco message types on a magicsock.Conn. Message types 0x80 and above are reserved for external use; types below 0x80 are reserved for the Tailscale protocol. disco package: - Add MinCustomMessageType (0x80) constant - Add ParseHookFunc type and ParseWithHook function magicsock package: - Add CustomDiscoMessage struct defining a custom message type (parser, handler, and whether to accept unknown peers) - Conn.AddCustomDiscoMessage registers a type (panics on reserved range or duplicate registration) - Conn.SendCustomDiscoOverDERP sends a custom message via DERP (rejects unregistered types) The feature is gated behind the "customdisco" feature tag (ts_omit_customdisco build tag) for dead code elimination. As of 2026-03-10 this is not yet a guaranteed stable API. Updates tailscale/corp#24454 Change-Id: I33b385f94ef63de9d359b9820203b2a7162dc609 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>