tailscale

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tailscale is a small client for the local Tailscale daemon's LocalAPI. It speaks HTTP/1.1 directly over the daemon's socket, named pipe, or authenticated localhost port, so Planck does not depend on tailscale.com.

Index

Constants

View Source
const (
	// TunnelMTU is the MTU Tailscale gives its TUN device; media packets on a
	// tailnet path must fit inside it.
	TunnelMTU = 1280

	DirectMaxBitrateKbps = 100_000
	RelayMaxBitrateKbps  = 20_000
)

Variables

View Source
var (
	// ErrNotRunning means no Tailscale daemon answered, or it is not in the
	// Running state (stopped, logged out, or waiting for auth).
	ErrNotRunning = errors.New("tailscale: not running")
	// ErrPeerNotFound means the address does not belong to a known tailnet node.
	ErrPeerNotFound = errors.New("tailscale: peer not found")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client talks to the local Tailscale daemon. The zero value is not usable; call New or NewUnix.

func New

func New() *Client

New returns a client for the platform's standard daemon location. The location is resolved on every call, so a daemon restart on a new port is picked up.

func NewUnix

func NewUnix(socketPath string) *Client

NewUnix returns a client for a tailscaled started with a custom --socket.

func (*Client) PathInfo

func (c *Client) PathInfo(ctx context.Context, peerIP netip.Addr) (PathInfo, error)

PathInfo reports how traffic to the peer owning peerIP currently flows.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*Status, error)

func (*Client) WhoIs

func (c *Client) WhoIs(ctx context.Context, remoteAddr string) (*PeerIdentity, error)

WhoIs identifies the tailnet node behind remoteAddr ("ip" or "ip:port"). IsSameUser is true only when the node belongs to the same user as this machine; tagged devices never match.

type Node

type Node struct {
	ID           string
	HostName     string
	DNSName      string
	OS           string
	UserID       int64
	UserLogin    string
	TailscaleIPs []netip.Addr
	Online       bool
	// CurAddr is the peer's current direct UDP endpoint; empty when traffic
	// goes through a relay or no handshake has happened yet.
	CurAddr string
	// Relay is the peer's home DERP region code (for example "den").
	Relay  string
	Direct bool
}

Node is one tailnet device as seen from this machine.

type PathInfo

type PathInfo struct {
	Direct                    bool
	Relay                     string
	MTU                       int
	RecommendedMaxBitrateKbps int
}

type PeerIdentity

type PeerIdentity struct {
	NodeID     string
	HostName   string
	DNSName    string
	UserID     int64
	LoginName  string
	IsSameUser bool
}

type Status

type Status struct {
	BackendState string
	Self         Node
	Peers        []Node
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL