Serve class abstract
Tailnet publication for an existing local HTTP service.
Reached via Tailscale.serve. Use this when you already have a local HTTP server (for example a Shelf app) bound to loopback and want Tailscale to publish it on this node's MagicDNS name.
For in-process request handling without a local TCP listener, prefer
Tailscale.http.bind(...); it is fd-backed and does not expose a loopback
port to other local processes.
serve.forward is process-scoped in this package, not a persistent
background tailscale serve --bg configuration surface. Close returned
handles explicitly; Tailscale.down() also removes package-created
publications best-effort.
Requests from tailnet clients follow upstream Tailscale Serve behavior:
Tailscale forwards identity headers such as Tailscale-User-Login,
Tailscale-User-Name, and Tailscale-User-Profile-Pic to the loopback
backend. Public Funnel requests do not include those headers.
Constructors
- Serve()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
{required int tailnetPort, String path = '/'}) → Future< void> -
Removes a tailnet Serve publication for
tailnetPortandpath. -
forward(
{required int tailnetPort, required int localPort, String localAddress = '127.0.0.1', String path = '/', bool https = true}) → Future< TailscalePublishedService> -
Publishes
http://[localAddress]:[localPort]inside the tailnet. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited