ExampleServer_HTTPClient shows you how to make HTTP requests over your tailnet. If you want to make outgoing HTTP connections to resources on your tailnet, use the HTTP client that the tsnet.Server exposes.
()
| 112 | // If you want to make outgoing HTTP connections to resources on your tailnet, use |
| 113 | // the HTTP client that the tsnet.Server exposes. |
| 114 | func ExampleServer_HTTPClient() { |
| 115 | srv := &tsnet.Server{} |
| 116 | cli := srv.HTTPClient() |
| 117 | |
| 118 | resp, err := cli.Get("https://hello.ts.net") |
| 119 | if resp == nil { |
| 120 | log.Fatal(err) |
| 121 | } |
| 122 | // do something with resp |
| 123 | _ = resp |
| 124 | } |
| 125 | |
| 126 | // ExampleServer_Start demonstrates the Start method, which should be called if |
| 127 | // you need to explicitly start it. Note that the Start method is implicitly |
nothing calls this directly
no test coverage detected
searching dependent graphs…