ConstMake an HTTP request through the Tailscale network. Supports method, headers, and body. Does not yet support AbortSignal, streaming bodies or responses, or other advanced Fetch API options.
Return the current Tailscale-managed DNS configuration. Synchronous — no await needed. Returns an empty DNSInfo object if called before init() resolves.
Return the current preferences (acceptRoutes, exitNodeId). Synchronous — no await needed. Must be called after init() resolves.
Return the full routing table (self + all peers). Synchronous — no await needed. Returns an empty array if called before init() resolves.
Initialize and connect the Tailscale node. Must be called before any other method. Resolves once the node is authenticated and ready.
If the node has persisted state from a previous session it reconnects automatically. Otherwise the OAuth flow is triggered via onAuthRequired. Rejects if the auth URL does not arrive within 60 seconds, or if the user does not complete authentication within 5 minutes.
Listen for inbound TCP connections on the given Tailscale port. Pass port 0 (default) to get an ephemeral port assigned automatically. onConnection is called for each accepted connection. Returns a Listener with the assigned port number and a close() method.
Return all peers that advertise exit-node capability. Synchronous — no await needed. Returns an empty array if called before init() resolves.
Return this node's Tailscale IPv4 address, or an empty string if not yet assigned. Synchronous — no await needed. Must be called after init() resolves.
Return this node's Tailscale IPv6 address, or an empty string if not yet assigned. Synchronous — no await needed. Must be called after init() resolves.
Send an ICMP ping to addr and measure round-trip time. addr may be a hostname or Tailscale IP.
Activate an exit node by its stable node ID. Pass an empty string (or omit) to clear the exit node.
Open a raw TCP connection through the Tailscale network. Returns a Connection object for sending and receiving data.