Documentation ¶
Overview ¶
Package httpts provides an HTTP server that runs on a Tailscale tailnet.
Every http.Request context served by this package has httpts.Who attached to it, telling you who is calling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthKey ¶
Types ¶
type Server ¶
type Server struct { // Handler answers requests from the tailnet. Handler http.Handler // FunnelHandler, if non-nil, answers requsts from the internet via Tailscale Funnel. // Unused if InsecureLocalPortOnly is true. FunnelHandler http.Handler // InsecureLocalPortOnly, if non-zero, means that no tsnet server is started // and instead the server listens over http:// on the specified 127.0.0.1 port. // It is insecure because all localhost handling is passed to Handler. InsecureLocalPortOnly int // StateStore, if non-nil, is used to store state for the tailscale client. StateStore ipn.StateStore AdvertiseTags []string // OauthClientSecret is used to authenticate the node if it is not already. // Create one at https://login.tailscale.com/admin/settings/oauth. // The client must be created with a tag that matches AdvertiseTags. // Note that the client secret must start with `tskey-client-`. // // Ignored if AuthKey is non-empty. // // Do not pass an OauthClientSecret to a server that you do not trust // to add nodes to your tailnet. OauthClientSecret string // AuthKey, if non-empty, is the auth key to create the node. AuthKey string // contains filtered or unexported fields }
Server is a drop-in for http.Server that serves a Handler on a tailnet.
type Who ¶
type Who struct { LoginName string PeerCap tailcfg.PeerCapMap }
Who is attached to every http.Request context naming the HTTP client.
func WhoFromCtx ¶
Click to show internal directories.
Click to hide internal directories.