udprelay

package
v1.84.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: BSD-3-Clause Imports: 16 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 Server

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

Server implements an experimental UDP relay server.

func NewServer

func NewServer(port int, addrs []netip.Addr) (s *Server, boundPort int, err error)

NewServer constructs a Server listening on 0.0.0.0:'port'. IPv6 is not yet supported. Port may be 0, and what ultimately gets bound is returned as 'boundPort'. Supplied 'addrs' are joined with 'boundPort' and returned as endpoint.ServerEndpoint.AddrPorts in response to Server.AllocateEndpoint() requests.

TODO: IPv6 support TODO: dynamic addrs:port discovery

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 ErrServerClosed if the server has been closed.

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