Tailscale class

Singleton embedded Tailscale node for the current Dart process. Wraps Tailscale's tsnet userspace library — the Dart app itself becomes a node on the tailnet, no OS-level VPN required.

This package runs one node per process. Configure it once with init, then access the singleton through instance.

Shape

Implemented types

Properties

diag Diag
latefinal
exitNode ExitNode
latefinal
funnel Funnel
latefinal
hashCode int
The hash code for this object.
no setterinherited
http Http
latefinal
onError Stream<TailscaleRuntimeError>
Background runtime errors pushed from the embedded node.
no setteroverride
onNodeChanges Stream<List<TailscaleNode>>
Emits the full node list on any change (node joined, left, went on/off-line, tags or DNS name changed).
no setteroverride
onStateChange Stream<NodeState>
Emits the new NodeState whenever the node's lifecycle state changes.
no setteroverride
prefs Prefs
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serve Serve
latefinal
tcp Tcp
latefinal
tls Tls
latefinal
udp Udp
latefinal

Methods

debugTerminateWorkerForTesting({bool expected = false, DebugTerminatePoint? at}) Future<void>
Terminates the supervised control isolate without touching native state — immediately when at is omitted, or armed at that exact lifecycle injection point (see DebugTerminatePoint). The caller-isolate rescue path must quarantine any matching runtime. expected applies only to an immediate termination.
down() Future<void>
Brings the embedded node down while preserving persisted credentials.
override
forgetLocalIdentity() Future<void>
Irreversibly removes this installation's local Tailscale identity.
override
logout() Future<void>
Asks upstream Tailscale to revoke and remove the current logical profile. The lower-level StateStore container remains in place for later enrollment; physical storage destruction is a separate explicit local-reset concern.
override
nodeByIp(String ip) Future<TailscaleNode?>
Returns the first known node with ip in its Tailscale IP list.
override
nodes() Future<List<TailscaleNode>>
Returns the current node inventory — every node on the tailnet this node is aware of, whether online right now or not.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
status() Future<TailscaleStatus>
Returns the current node status — lifecycle state, assigned tailnet IPs, health warnings, and MagicDNS suffix. Node inventory is separate; call nodes when you need it.
override
toString() String
A string representation of this object.
inherited
up({String hostname = '', String? authKey, bool ephemeral = false, Uri? controlUrl, Duration timeout = const Duration(seconds: 30)}) Future<TailscaleStatus>
Brings the embedded Tailscale node up and connects to the control plane — Tailscale's coordination service at controlplane.tailscale.com, or a self-hosted Headscale if you set controlUrl. Registers the node on first launch, reconnects from persisted credentials on subsequent launches.
override
whois(String ip) Future<TailscaleNodeIdentity?>
Resolves a tailnet IP to the node's identity — stable node ID, owner login, hostname, and ACL tags — by querying the local LocalAPI.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance Tailscale
final

Static Methods

init({required String stateDir, required String appId, TailscaleLogLevel logLevel = TailscaleLogLevel.silent, bool noLogsNoSupport = false}) → void
Configures the Tailscale library. Call this once at app startup, alongside other library initializers.