server

package
v0.23.0-beta3.patch4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DERPBootstrapDNSHandler

func DERPBootstrapDNSHandler(
	derpMap *tailcfg.DERPMap,
) func(http.ResponseWriter, *http.Request)

DERPBootstrapDNSHandler implements the /bootstrap-dns endpoint Described in https://github.com/tailscale/tailscale/issues/1405, this endpoint provides a way to help a client when it fails to start up because its DNS are broken. The initial implementation is here https://github.com/tailscale/tailscale/pull/1406 They have a cache, but not clear if that is really necessary at Headscale, uh, scale. An example implementation is found here https://derp.tailscale.com/bootstrap-dns Coordination server is included automatically, since local DERP is using the same DNS Name in d.serverURL.

func DERPProbeHandler

func DERPProbeHandler(
	writer http.ResponseWriter,
	req *http.Request,
)

DERPProbeHandler is the endpoint that js/wasm clients hit to measure DERP latency, since they can't do UDP STUN queries.

Types

type DERPServer

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

func NewDERPServer

func NewDERPServer(
	serverURL string,
	derpKey key.NodePrivate,
	cfg *types.DERPConfig,
) (*DERPServer, error)

func (*DERPServer) DERPHandler

func (d *DERPServer) DERPHandler(
	writer http.ResponseWriter,
	req *http.Request,
)

func (*DERPServer) GenerateRegion

func (d *DERPServer) GenerateRegion() (tailcfg.DERPRegion, error)

func (*DERPServer) ServeSTUN

func (d *DERPServer) ServeSTUN()

ServeSTUN starts a STUN server on the configured addr.

Jump to

Keyboard shortcuts

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