ipnserver
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package ipnserver runs the LocalAPI HTTP server that communicateswith the LocalBackend.
Index¶
- func NewContextWithActorForTest(ctx context.Context, actor ipnauth.Actor) context.Context
- type Server
- func (s *Server) BlockWhileInUseByOtherForTest(ctx context.Context, actor ipnauth.Actor) error
- func (s *Server) BlockWhileInUseForTest(ctx context.Context) error
- func (s *Server) Run(ctx context.Context, ln net.Listener) error
- func (s *Server) ServeHTMLStatus(w http.ResponseWriter, r *http.Request)
- func (s *Server) ServeHTTPForTest(w http.ResponseWriter, r *http.Request)
- func (s *Server) SetLocalBackend(lb *ipnlocal.LocalBackend)
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
Types¶
typeServer¶added inv1.18.0
type Server struct {// contains filtered or unexported fields}Server is an IPN backend and its set of 0 or more active localhostTCP or unix socket connections talking to that backend.
funcNew¶added inv1.18.0
New returns a new Server.
To start it, use the Server.Run method.
At some point, either before or after Run, the Server's SetLocalBackendmethod must also be called before Server can do anything useful.
func (*Server)BlockWhileInUseByOtherForTest¶added inv1.84.0
BlockWhileInUseByOtherForTest blocks while the actor can't connect to the server becausethe server is in use by a different actor. It is used in tests only.
func (*Server)BlockWhileInUseForTest¶added inv1.84.0
BlockWhileInUseForTest blocks until the server becomes idle (no active requests),or the specified context is done. It returns the context's error if it is done.It is used in tests only.
func (*Server)Run¶added inv1.18.0
Run runs the server, accepting connections from ln forever.
If the context is done, the listener is closed. It is also the base contextof 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 inv1.18.0
func (s *Server) ServeHTMLStatus(whttp.ResponseWriter, r *http.Request)
ServeHTMLStatus serves an HTML status page athttp://localhost:41112/ forWindows and via $DEBUG_LISTENER/debug/ipn when tailscaled's --debug flagis used to run a debug server.
func (*Server)ServeHTTPForTest¶added inv1.84.0
func (s *Server) ServeHTTPForTest(whttp.ResponseWriter, r *http.Request)
ServeHTTPForTest responds to a single LocalAPI HTTP request.The request's context carries the actor that made the requestand can be created withNewContextWithActorForTest.It is used in tests only.
func (*Server)SetLocalBackend¶added inv1.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.