ipnserver

package
v0.0.0-...-113f59a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an IPN backend and its set of 0 or more active localhost TCP or unix socket connections talking to that backend.

func New

func New(logf logger.Logf, logID logid.PublicID, netMon *netmon.Monitor) *Server

New returns a new Server.

To start it, use the Server.Run method.

At some point, either before or after Run, the Server's SetLocalBackend method must also be called before Server can do anything useful.

func (*Server) Run

func (s *Server) Run(ctx context.Context, ln net.Listener) error

Run runs the server, accepting connections from ln forever.

If the context is done, the listener is closed. It is also the base context of all HTTP requests.

If the Server's LocalBackend has already been set, Run starts it. Otherwise, the next call to SetLocalBackend will start it.

func (*Server) ServeHTMLStatus

func (s *Server) ServeHTMLStatus(w http.ResponseWriter, r *http.Request)

ServeHTMLStatus serves an HTML status page at http://localhost:41112/ for Windows and via $DEBUG_LISTENER/debug/ipn when tailscaled's --debug flag is used to run a debug server.

func (*Server) SetLocalBackend

func (s *Server) SetLocalBackend(lb *ipnlocal.LocalBackend)

SetLocalBackend sets the server's LocalBackend.

If b.Run has already been called, then lb.Start will be called. Otherwise Start will be called once Run is called.

Jump to

Keyboard shortcuts

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