MCPcopy
hub / github.com/tailscale/tailscale / ExampleServer_Start

Function ExampleServer_Start

tsnet/example_tsnet_test.go:129–139  ·  view source on GitHub ↗

ExampleServer_Start demonstrates the Start method, which should be called if you need to explicitly start it. Note that the Start method is implicitly called if needed.

()

Source from the content-addressed store, hash-verified

127// you need to explicitly start it. Note that the Start method is implicitly
128// called if needed.
129func ExampleServer_Start() {
130 srv := new(tsnet.Server)
131
132 if err := srv.Start(); err != nil {
133 log.Fatal(err)
134 }
135
136 // Be sure to close the server instance at some point. It will stay open until
137 // either the OS process ends or the server is explicitly closed.
138 defer srv.Close()
139}
140
141// ExampleServer_Listen shows you how to create a TCP listener on your tailnet and
142// then makes an HTTP server on top of that.

Callers

nothing calls this directly

Calls 3

StartMethod · 0.65
FatalMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…