ipnserver

package
v1.74.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: BSD-3-Clause Imports: 31 Imported by: 15

Documentation

Overview

Package ipnserver runs the LocalAPI HTTP server that communicates with the LocalBackend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server added in v1.18.0

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 added in v1.18.0

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 added in v1.18.0

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 added in v1.18.0

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 added in v1.34.0

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

SetLocalBackend sets the server's LocalBackend.

It should only call be called after calling lb.Start.

Jump to

Keyboard shortcuts

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