Movatterモバイル変換


[0]ホーム

URL:


web

package
v1.92.3Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:45Imported by:6

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package web provides the Tailscale client for web.

Index

Constants

View Source
const ListenPort = 5252

ListenPort is the static port used for the web client when run inside tailscaled.(5252 are the numbers above the letters "TSTS" on a qwerty keyboard.)

Variables

This section is empty.

Functions

This section is empty.

Types

typeServer

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

Server is the backend server for a Tailscale web client.

funcNewServer

func NewServer(optsServerOpts) (s *Server, errerror)

NewServer constructs a new Tailscale web client server.If err is empty, s is always non-nil.ctx is only required to live the duration of the NewServer call,and not the lifespan of the web server.

func (*Server)ServeHTTP

func (s *Server) ServeHTTP(whttp.ResponseWriter, r *http.Request)

ServeHTTP processes all requests for the Tailscale web client.

func (*Server)Shutdownadded inv1.54.0

func (s *Server) Shutdown()

typeServerModeadded inv1.54.0

type ServerModestring

ServerMode specifies the mode of a running web.Server.

const (// LoginServerMode serves a read-only login client for logging a// node into a tailnet, and viewing a read-only interface of the// node's current Tailscale settings.//// In this mode, API calls are authenticated via platform auth.LoginServerModeServerMode = "login"// ReadOnlyServerMode is identical to LoginServerMode,// but does not present a login button to switch to manage mode,// even if the management client is running and reachable.//// This is designed for platforms where the device is configured by other means,// such as Home Assistant's declarative YAML configuration.ReadOnlyServerModeServerMode = "readonly"// ManageServerMode serves a management client for editing tailscale// settings of a node.//// This mode restricts the app to only being assessible over Tailscale,// and API calls are authenticated via browser sessions associated with// the source's Tailscale identity. If the source browser does not have// a valid session, a read-only version of the app is displayed.ManageServerModeServerMode = "manage")

typeServerOptsadded inv1.50.0

type ServerOpts struct {// Mode specifies the mode of web client being constructed.ModeServerMode// CGIMode indicates if the server is running as a CGI script.CGIModebool// PathPrefix is the URL prefix added to requests by CGI or reverse proxy.PathPrefixstring// LocalClient is the local.Client to use for this web server.// If nil, a new one will be created.LocalClient *local.Client// TimeNow optionally provides a time function.// time.Now is used as default.TimeNow func()time.Time// Logf optionally provides a logger function.// If nil, log.Printf is used as default.Logflogger.Logf// PolicyClient, if non-nil, will be used to fetch policy settings.// If nil, the default policy client will be used.PolicyClientpolicyclient.Client// NewAuthURL should be provided as a function that generates// a new tailcfg.WebClientAuthResponse.// This field is required for ManageServerMode mode.NewAuthURL func(ctxcontext.Context, srctailcfg.NodeID) (*tailcfg.WebClientAuthResponse,error)// WaitAuthURL should be provided as a function that blocks until// the associated tailcfg.WebClientAuthResponse has been marked// as completed.// This field is required for ManageServerMode mode.WaitAuthURL func(ctxcontext.Context, idstring, srctailcfg.NodeID) (*tailcfg.WebClientAuthResponse,error)// OriginOverride specifies the origin that the web UI will be accessible from if hosted behind a reverse proxy or CGI.OriginOverridestring}

ServerOpts contains options for constructing a new Server.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp