code: func NewAgent(cfg AgentConfig) (*Agent, error) {
  	if err := cfg.CheckAndSetDefaults(); err != nil {
  		return nil, trace.Wrap(err)
  	}
  	ctx, cancel := context.WithCancel(cfg.Context)
  	a := &Agent{
  		AgentConfig: cfg,
  		ctx:         ctx,
  		cancel:      cancel,
  		authMethods: []ssh.AuthMethod{ssh.PublicKeys(cfg.Signers...)},
  	}
  	if len(cfg.DiscoverProxies) == 0 {
  		a.state = agentStateConnecting
  	} else {
  		a.state = agentStateDiscovering
  	}
  	a.Entry = log.WithFields(log.Fields{
  		trace.Component: teleport.ComponentReverseTunnelAgent,
  		trace.ComponentFields: log.Fields{
  			"target": cfg.Addr.String(),
  		},
  	})
  	a.hostKeyCallback = a.checkHostSignature
  	return a, nil
  }
docs: // NewAgent returns a new reverse tunnel agent