udprelay

package
v1.86.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: BSD-3-Clause Imports: 24 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 int, overrideAddrs []netip.Addr) (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 len(overrideAddrs) > 0 these will be used in place of dynamic discovery, which is useful to override in tests.

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.

Directories

Path Synopsis
Package endpoint contains types relating to UDP relay server endpoints.
Package endpoint contains types relating to UDP relay server endpoints.

Jump to

Keyboard shortcuts

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