config

package
v1.29.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const HasTailscale = true

Variables

View Source
var TailscaleSuffix = ".ts.net"

TailscaleSuffix is the suffix for server names which will use the tailscale client instead of the autocert client. Not expected to be changed but just in case.

Functions

func IsTailscale added in v1.22.0

func IsTailscale(serverName string) bool

IsTailscale returns true if the server name ends with the TailscaleSuffix. Note the check is expecting lowercase serverName which is what hello.ServerName already is.

func TailscaleServerName added in v1.24.0

func TailscaleServerName() string

Types

type CertificateProvider added in v1.22.0

type CertificateProvider interface {
	GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
}

CertificateProvider interface is used to hide the tailscale dependency when not using it, could also be use as a generic mapping between server name and cert provider (while right now it's either autocert or tailscale).

func Tailscale added in v1.22.0

func Tailscale() CertificateProvider

type JSONURL added in v0.2.0

type JSONURL struct {
	Str string
	URL url.URL
}

func FromString added in v1.23.0

func FromString(urlStr string) (JSONURL, error)

func (*JSONURL) UnmarshalJSON added in v0.2.0

func (j *JSONURL) UnmarshalJSON(b []byte) error

UnmarshalJSON is needed to get a URL from json until golang does it on its own.

type Route

type Route struct {
	// Host or * or empty to match any host (* without a Prefix must be the last rule)
	Host string
	// Prefix or empty for any
	Prefix string
	// Destination url string.
	Destination JSONURL
}

Route configuration. Does Host/Prefix match to destination, see Match* functions. (only host,port,scheme part of Destination URL are used). User lowercase for the config. Incoming Host/Authority header will be lowercased. Paths (prefix) are case sensitive.

func (*Route) MatchHostAndPath added in v1.0.0

func (r *Route) MatchHostAndPath(hostPort, path string) bool

func (*Route) MatchServerReq added in v1.0.0

func (r *Route) MatchServerReq(req *http.Request) bool

Jump to

Keyboard shortcuts

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