derpbind

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CustomDERPServerEnv = "DERPHOLE_DERP_SERVER"
	DefaultDERPPort     = uint16(443)
	DefaultSTUNPort     = uint16(3478)
	CustomDERPRegionID  = 900
)
View Source
const PublicDERPMapURL = "https://controlplane.tailscale.com/derpmap/default"

Variables

This section is empty.

Functions

func FetchMap

func FetchMap(ctx context.Context, url string) (*tailcfg.DERPMap, error)

func WrapCustomDERPConnectError added in v0.17.0

func WrapCustomDERPConnectError(route Route, finalServerURL string, cause error) error

WrapCustomDERPConnectError keeps connection diagnostics and the original cause while replacing final DERP URLs with the canonical embedded authority.

Types

type Client

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

func NewClient

func NewClient(ctx context.Context, node *tailcfg.DERPNode, serverURL string) (*Client, error)

func NewClientWithPrivateKey added in v0.8.0

func NewClientWithPrivateKey(ctx context.Context, node *tailcfg.DERPNode, serverURL string, priv key.NodePrivate) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) ProxyInfo added in v0.17.0

func (c *Client) ProxyInfo() (ProxyInfo, bool)

func (*Client) PublicKey

func (c *Client) PublicKey() key.NodePublic

func (*Client) Receive

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

func (*Client) Send

func (c *Client) Send(ctx context.Context, dst key.NodePublic, payload []byte) error

func (*Client) Subscribe

func (c *Client) Subscribe(filter func(Packet) bool) (<-chan Packet, func())

func (*Client) SubscribeLossless

func (c *Client) SubscribeLossless(filter func(Packet) bool) (<-chan Packet, func())

type Packet

type Packet struct {
	From    key.NodePublic
	Payload []byte
}

type ProxyInfo added in v0.17.0

type ProxyInfo struct {
	Scheme     string
	ProxyAddr  string
	TargetAddr string
}

func (ProxyInfo) DebugString added in v0.17.0

func (i ProxyInfo) DebugString() string

type Route added in v0.17.0

type Route struct {
	Host     string `json:"host"`
	DERPPort uint16 `json:"derp_port"`
	STUNPort uint16 `json:"stun_port"`
}

func NewCustomRoute added in v0.17.0

func NewCustomRoute(host string, derpPort, stunPort uint16) (Route, error)

func ParseCustomRoute added in v0.17.0

func ParseCustomRoute(raw string) (Route, error)

func ParseRouteWire added in v0.17.0

func ParseRouteWire(src []byte) (Route, int, error)

func RouteFromEnvironment added in v0.17.0

func RouteFromEnvironment() (Route, error)

func (Route) AppendWire added in v0.17.0

func (r Route) AppendWire(dst []byte) ([]byte, error)

func (Route) DERPAuthority added in v0.17.0

func (r Route) DERPAuthority() string

func (Route) DERPMap added in v0.17.0

func (r Route) DERPMap() *tailcfg.DERPMap

func (Route) IsCustom added in v0.17.0

func (r Route) IsCustom() bool

func (Route) STUNAuthority added in v0.17.0

func (r Route) STUNAuthority() string

func (Route) ServerURL added in v0.17.0

func (r Route) ServerURL() string

func (Route) Validate added in v0.17.0

func (r Route) Validate() error

Jump to

Keyboard shortcuts

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