overlay

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: CC0-1.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAuth

type ClientAuth struct {
	// OverlayPrivateKey is the main auth mechanism used to secure the overlay.
	// Peers are sent this private key to encrypt node communication to the
	// receiver. Leaking this private key would allow anyone to connect.
	OverlayPrivateKey key.NodePrivate
	// ReceiverPublicKey is the public key of the receiver. Node messages are
	// encrypted to this public key.
	ReceiverPublicKey key.NodePublic
	// ReceiverStunAddr is the address that the receiver is reachable over UDP
	// when the overlay is running in P2P mode.
	ReceiverStunAddr netip.AddrPort
	// ReceiverDERPRegionID is the region id that the receiver is reachable over
	// DERP when the overlay is running in DERP mode.
	ReceiverDERPRegionID uint16
}

func (*ClientAuth) AuthKey

func (ca *ClientAuth) AuthKey() string

func (*ClientAuth) Parse

func (ca *ClientAuth) Parse(authKey string) error

func (*ClientAuth) PrintDebug added in v0.0.6

func (ca *ClientAuth) PrintDebug(logf func(str string, args ...any), dm *tailcfg.DERPMap)

type HostInfo added in v0.1.1

type HostInfo struct {
	Username string
	Hostname string
}

type Overlay

type Overlay interface {
	// listenOverlay(ctx context.Context, kind string) error
	Recv() <-chan *tailcfg.Node
	Send() chan<- *tailcfg.Node
	IP() netip.Addr
}

Overlay specifies the mechanism by which senders and receivers exchange Tailscale nodes over a sidechannel.

type Receive

type Receive struct {
	Logger  *slog.Logger
	DerpMap *tailcfg.DERPMap
	// SelfPriv is the private key that peers will encrypt overlay messages to.
	// The public key of this is sent in the auth key.
	SelfPriv key.NodePrivate
	// PeerPriv is the main auth mechanism used to secure the overlay. Peers are
	// sent this private key to encrypt node communication. Leaking this private
	// key would allow anyone to connect.
	PeerPriv key.NodePrivate
	// contains filtered or unexported fields
}

func NewReceiveOverlay

func NewReceiveOverlay(logger *slog.Logger, dm *tailcfg.DERPMap) *Receive

func (*Receive) ClientAuth

func (r *Receive) ClientAuth() *ClientAuth

func (*Receive) IP

func (r *Receive) IP() netip.Addr

func (*Receive) ListenOverlayDERP

func (r *Receive) ListenOverlayDERP(ctx context.Context) error

func (*Receive) ListenOverlaySTUN

func (r *Receive) ListenOverlaySTUN(ctx context.Context) (<-chan struct{}, error)

func (*Receive) PickDERPHome

func (r *Receive) PickDERPHome(ctx context.Context) error

func (*Receive) Recv

func (r *Receive) Recv() <-chan *tailcfg.Node

func (*Receive) Send

func (r *Receive) Send() chan<- *tailcfg.Node

type Send

type Send struct {
	Logger         *slog.Logger
	STUNIPOverride netip.Addr

	Auth ClientAuth
	// contains filtered or unexported fields
}

func NewSendOverlay

func NewSendOverlay(logger *slog.Logger, dm *tailcfg.DERPMap) *Send

func (*Send) IP

func (s *Send) IP() netip.Addr

func (*Send) ListenOverlayDERP

func (s *Send) ListenOverlayDERP(ctx context.Context) error

func (*Send) ListenOverlaySTUN

func (s *Send) ListenOverlaySTUN(ctx context.Context) error

func (*Send) Recv

func (s *Send) Recv() <-chan *tailcfg.Node

func (*Send) Send

func (s *Send) Send() chan<- *tailcfg.Node

Jump to

Keyboard shortcuts

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