tsweb

package
v0.96.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: BSD-3-Clause Imports: 15 Imported by: 31

Documentation

Overview

Package tsweb contains code between various Tailscale webservers.

Index

Constants

This section is empty.

Variables

View Source
var DevMode bool

DevMode controls whether extra output in shown, for when the binary is being run in dev mode.

Functions

func AllowDebugAccess

func AllowDebugAccess(r *http.Request) bool

AllowDebugAccess reports whether r should be permitted to access various debug endpoints.

func DefaultCertDir

func DefaultCertDir(leafDir string) string

func IsProd443

func IsProd443(addr string) bool

IsProd443 reports whether addr is a Go listen address for port 443.

func NewMux

func NewMux(debugHandler http.Handler) *http.ServeMux

NewMux returns a new ServeMux with debugHandler registered (and protected) at /debug/.

func Protected

func Protected(h http.Handler) http.Handler

Protected wraps a provided debug handler, h, returning a Handler that enforces AllowDebugAccess and returns forbiden replies for unauthorized requests.

func RegisterCommonDebug

func RegisterCommonDebug(mux *http.ServeMux)

func Uptime

func Uptime() time.Duration

Types

type Port80Handler

type Port80Handler struct{ Main http.Handler }

Port80Handler is the handler to be given to autocert.Manager.HTTPHandler. The inner handler is the mux returned by NewMux containing registered /debug handlers.

func (Port80Handler) ServeHTTP

func (h Port80Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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