ts

package
v1.17.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TSPortForwardPort is the fixed port on which the workspace WebSocket reverse proxy listens.
	TSPortForwardPort string = "12051"

	// DevsyTSNetDomain is the MagicDNS suffix for the Devsy tailnet.
	DevsyTSNetDomain = "ts.devsy"

	RunnerProxySocket string = "runner-proxy.sock"
)

Variables

This section is empty.

Functions

func CheckDerpConnection

func CheckDerpConnection(ctx context.Context, baseUrl *url.URL, insecure bool) error

CheckDerpConnection validates the DERP connection. insecure skips TLS certificate verification, for coordinators known to use self-signed certs.

func GetClientHostname

func GetClientHostname(userName string) (string, error)

func GetEnvOrDefault

func GetEnvOrDefault(envVar, defaultVal string) string

func GetURL

func GetURL(host string, port int) string

func GetWorkspaceHostname

func GetWorkspaceHostname(name, namespace string) string

func ParseWorkspaceHostname

func ParseWorkspaceHostname(hostname string) (name string, project string, err error)

func PersistNetmapStatus added in v1.17.0

func PersistNetmapStatus(rootDir string, status *ipnstate.Status)

PersistNetmapStatus marshals status and writes it to netmap.json under rootDir for debugging, logging rather than returning any failure since callers invoke this from a WatchNetmap callback with no error path.

func RemoveProtocol

func RemoveProtocol(hostPath string) string

func ToUint16Port added in v1.17.0

func ToUint16Port(port int) (uint16, error)

ToUint16Port validates that port fits the uint16 range TCP ports use.

func WaitForSSHClient

func WaitForSSHClient(ctx context.Context, cfg SSHDialConfig) (*ssh.Client, error)

func WatchNetmap

func WatchNetmap(
	ctx context.Context,
	lc *local.Client,
	netmapChangedFn func(status *ipnstate.Status),
) error

Types

type Addr

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

func NewAddr

func NewAddr(rawHost string, port int) Addr

func (Addr) Host

func (a Addr) Host() string

func (Addr) Network

func (a Addr) Network() string

func (Addr) Port

func (a Addr) Port() int

func (Addr) PortUint16 added in v1.17.0

func (a Addr) PortUint16() (uint16, error)

PortUint16 returns Port bounds-checked for use with APIs that take a uint16 port, such as *local.Client.DialTCP.

func (Addr) String

func (a Addr) String() string

type Dialer

type Dialer func(ctx context.Context, network, address string) (net.Conn, error)

type SSHDialConfig added in v1.17.0

type SSHDialConfig struct {
	Dialer  Dialer
	Network string
	Address string
	User    string
	Timeout time.Duration
}

SSHDialConfig bundles the parameters needed to establish and retry an SSH connection over a tailnet dialer.

type WorkspaceServer

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

WorkspaceServer holds the TSNet server and its listeners.

func NewWorkspaceServer

func NewWorkspaceServer(config *WorkspaceServerConfig) *WorkspaceServer

func (*WorkspaceServer) Dial

func (s *WorkspaceServer) Dial(ctx context.Context, network, addr string) (net.Conn, error)

func (*WorkspaceServer) Start

func (s *WorkspaceServer) Start(ctx context.Context) error

Start initializes the TSNet server, sets up listeners for SSH and HTTP reverse proxy traffic, and waits until the given context is canceled.

func (*WorkspaceServer) Stop

func (s *WorkspaceServer) Stop()

Stop shuts down all listeners and the TSNet server.

type WorkspaceServerConfig

type WorkspaceServerConfig struct {
	AccessKey     string
	PlatformHost  string
	WorkspaceHost string
	LogF          func(format string, args ...any)
	RootDir       string
	// Insecure skips TLS certificate verification for the DERP probe and
	// the TSNet control-plane connection. Only set for coordinators known
	// to use self-signed certificates.
	Insecure bool
}

WorkspaceServerConfig defines configuration for the TSNet instance.

Jump to

Keyboard shortcuts

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