Documentation
¶
Overview ¶
Package udprelay contains constructs for relaying Disco and WireGuard packets between Tailscale clients over UDP. This package is currently considered experimental.
Index ¶
- Variables
- type ErrServerNotReady
- type Server
- func (s *Server) AllocateEndpoint(discoA, discoB key.DiscoPublic) (endpoint.ServerEndpoint, error)
- func (s *Server) Close() error
- func (s *Server) GetSessions() []status.ServerSession
- func (s *Server) SetDERPMapView(view tailcfg.DERPMapView)
- func (s *Server) SetStaticAddrPorts(addrPorts views.Slice[netip.AddrPort])
Constants ¶
This section is empty.
Variables ¶
var ErrServerClosed = errors.New("server closed")
Functions ¶
This section is empty.
Types ¶
type ErrServerNotReady ¶ added in v1.86.0
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:
- ErrServerClosed if the server has been closed.
- ErrServerNotReady if the server is not ready.
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
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. |