Skip to content

Add application-layer UDP support #23

Description

@mithyer

Summary

Tailcat currently exposes TCP-oriented application APIs (OnTCP, OnTCPForward, DialTCPPort, and DialTCP). This prevents applications that require UDP datagrams from using the Tailcat tunnel, even though the underlying data plane already uses UDP for direct paths and Tailscale's networking stack supports UDP traffic.

Would it make sense to expose generic application-layer UDP support, independent of any particular application protocol?

Possible scope

  • Add a client-side UDP/net.PacketConn API.
  • Add server-side UDP handlers and forwarding APIs.
  • Preserve datagram boundaries and source/destination port information.
  • Route packets correctly when multiple clients are connected to one server.
  • Extend packet filtering, allowlists, and exit-node behavior to cover UDP.
  • Reuse the existing endpoint discovery, direct UDP path, and DERP fallback where practical.
  • Document the CLI behavior for serving or forwarding UDP ports.
  • Add tests for direct paths, DERP fallback, multiple clients, lifecycle, MTU limits, and network changes.

The implementation could reuse or follow the relevant upstream Tailscale/netstack behavior where appropriate. It should not require a new control plane.

Motivation

UDP support would allow Tailcat to carry DNS, real-time media, game networking, and other datagram-based protocols in addition to TCP services. A generic net.PacketConn-style API would also keep the feature useful without coupling Tailcat to one application protocol.

Tailcat's current connection model already provides peer identity, NAT traversal, direct-path discovery, and relay fallback; this request is primarily about exposing UDP at the application layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions