code: func (proxy *ProxyClient) isRecordingProxy() (bool, error) {
  	responseCh := make(chan proxyResponse)
  
  	// we have to run this in a goroutine because older version of Teleport handled
  	// global out-of-band requests incorrectly: Teleport would ignore requests it
  	// does not know about and never reply to them. So if we wait a second and
  	// don't hear anything back, most likley we are trying to connect to an older
  	// version of Teleport and we should not try and forward our agent.
  	go func() {
  		ok, responseBytes, err := proxy.Client.SendRequest(teleport.RecordingProxyReqType, true, nil)
  		if err != nil {
  			responseCh <- proxyResponse{isRecord: false, err: trace.Wrap(err)}
  			return
  		}
  		if !ok {
  			responseCh <- proxyResponse{isRecord: false, err: trace.AccessDenied("unable to determine proxy type")}
  			return
  		}
  
  		recordingProxy, err := strconv.ParseBool(string(responseBytes))
  		if err != nil {
  			responseCh <- proxyResponse{isRecord: false, err: trace.Wrap(err)}
  			return
  		}
  
  		responseCh <- proxyResponse{isRecord: recordingProxy, err: nil}
  	}()
  
  	select {
  	case resp := <-responseCh:
  		if resp.err != nil {
  			return false, trace.Wrap(resp.err)
  		}
  		return resp.isRecord, nil
  	case <-time.After(1 * time.Second):
  		// probably the older version of the proxy or at least someone that is
  		// responding incorrectly, don't forward agent to it
  		return false, nil
  	}
  }
docs: // isRecordingProxy returns true if the proxy is in recording mode. Note, this
  // function can only be called after authentication has occurred and should be
  // called before the first session is created.