(ctx context.Context, agentID uuid.UUID, network, addr string)
| 314 | } |
| 315 | |
| 316 | func (s *ServerTailnet) DialAgentNetConn(ctx context.Context, agentID uuid.UUID, network, addr string) (net.Conn, error) { |
| 317 | conn, release, err := s.AgentConn(ctx, agentID) |
| 318 | if err != nil { |
| 319 | return nil, xerrors.Errorf("acquire agent conn: %w", err) |
| 320 | } |
| 321 | |
| 322 | // Since we now have an open conn, be careful to close it if we error |
| 323 | // without returning it to the user. |
| 324 | |
| 325 | nc, err := conn.DialContext(ctx, network, addr) |
| 326 | if err != nil { |
| 327 | release() |
| 328 | return nil, xerrors.Errorf("dial context: %w", err) |
| 329 | } |
| 330 | |
| 331 | return &netConnCloser{Conn: nc, close: func() { |
| 332 | release() |
| 333 | }}, err |
| 334 | } |
| 335 | |
| 336 | func (s *ServerTailnet) ServeHTTPDebug(w http.ResponseWriter, r *http.Request) { |
| 337 | s.conn.MagicsockServeHTTPDebug(w, r) |
no test coverage detected