udprelay

package
v1.94.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: BSD-3-Clause Imports: 41 Imported by: 0

Documentation

Overview

Package udprelay contains constructs for relaying Disco and WireGuard packets between Tailscale clients over UDP. This package is currently considered experimental.

Index

Constants

This section is empty.

Variables

View Source
var ErrServerClosed = errors.New("server closed")

Functions

This section is empty.

Types

type ErrServerNotReady added in v1.86.0

type ErrServerNotReady struct {
	RetryAfter time.Duration
}

ErrServerNotReady indicates the server is not ready. Allocation should be requested after waiting for at least RetryAfter duration.

func (ErrServerNotReady) Error added in v1.86.0

func (e ErrServerNotReady) Error() string

type Server

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

Server implements an experimental UDP relay server.

func NewServer

func NewServer(logf logger.Logf, port uint16, onlyStaticAddrPorts bool, metrics *usermetric.Registry) (s *Server, err error)

NewServer constructs a Server listening on port. If port is zero, then port selection is left up to the host networking stack. If onlyStaticAddrPorts is true, then dynamic addr:port discovery will be disabled, and only addr:port's set via Server.SetStaticAddrPorts will be used. Metrics must be non-nil.

func (*Server) AllocateEndpoint

func (s *Server) AllocateEndpoint(discoA, discoB key.DiscoPublic) (endpoint.ServerEndpoint, error)

AllocateEndpoint allocates an endpoint.ServerEndpoint for the provided pair of key.DiscoPublic's. If an allocation already exists for discoA and discoB it is returned without modification/reallocation. AllocateEndpoint returns the following notable errors:

  1. ErrServerClosed if the server has been closed.
  2. ErrServerNotReady if the server is not ready.

func (*Server) Close

func (s *Server) Close() error

Close closes the server.

func (*Server) GetSessions added in v1.90.0

func (s *Server) GetSessions() []status.ServerSession

GetSessions returns a slice of peer relay session statuses, with each entry containing detailed info about the server and clients involved in each session. This information is intended for debugging/status UX, and should not be relied on for any purpose outside of that.

func (*Server) SetDERPMapView added in v1.90.7

func (s *Server) SetDERPMapView(view tailcfg.DERPMapView)

SetDERPMapView sets the tailcfg.DERPMapView to use for future netcheck reports.

func (*Server) SetStaticAddrPorts added in v1.92.0

func (s *Server) SetStaticAddrPorts(addrPorts views.Slice[netip.AddrPort])

SetStaticAddrPorts sets addr:port pairs the Server will advertise as candidates it is potentially reachable over, in combination with dynamically discovered pairs. This replaces any previously-provided static values.

Directories

Path Synopsis
Package endpoint contains types relating to UDP relay server endpoints.
Package endpoint contains types relating to UDP relay server endpoints.
Package status contains types relating to the status of peer relay sessions between peer relay client nodes via a peer relay server.
Package status contains types relating to the status of peer relay sessions between peer relay client nodes via a peer relay server.

Jump to

Keyboard shortcuts

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