code: func (tc *TeleportClient) ConnectToProxy(ctx context.Context) (*ProxyClient, error) {
  	var err error
  	var proxyClient *ProxyClient
  
  	// Use connectContext and the cancel function to signal when a response is
  	// returned from connectToProxy.
  	connectContext, cancel := context.WithCancel(context.Background())
  	go func() {
  		defer cancel()
  		proxyClient, err = tc.connectToProxy(ctx)
  	}()
  
  	select {
  	// ConnectToProxy returned a result, return that back to the caller.
  	case <-connectContext.Done():
  		return proxyClient, trace.Wrap(err)
  	// The passed in context timed out. This is often due to the network being
  	// down and the user hitting Ctrl-C.
  	case <-ctx.Done():
  		return nil, trace.ConnectionProblem(ctx.Err(), "connection canceled")
  	}
  }
docs: // ConnectToProxy will dial to the proxy server and return a ProxyClient when
  // successful. If the passed in context is canceled, this function will return
  // a trace.ConnectionProblem right away.