Documentation
¶
Index ¶
Constants ¶
const HasTailscale = true
Variables ¶
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
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
func FromString ¶ added in v1.23.0
func (*JSONURL) UnmarshalJSON ¶ added in v0.2.0
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.