func NewServer(addr utils.NetAddr, hostSigners []ssh.Signer,
	authAPI auth.AccessPoint, opts ...ServerOption) (Server, error) {

	srv := &server{
		directSites: []*directSite{},
		tunnelSites: []*tunnelSite{},
		localAuth:   authAPI,
	}
	var err error
	srv.limiter, err = limiter.NewLimiter(limiter.LimiterConfig{})
	if err != nil {
		return nil, trace.Wrap(err)
	}

	for _, o := range opts {
		o(srv)
	}
	if srv.timeout == 0 {
		srv.timeout = teleport.DefaultTimeout
	}

	s, err := sshutils.NewServer(
		teleport.ComponentReverseTunnel,
		addr,
		srv,
		hostSigners,
		sshutils.AuthMethods{
			PublicKey: srv.keyAuth,
		},
		sshutils.SetLimiter(srv.limiter),
	)
	if err != nil {
		return nil, err
	}
	srv.hostCertChecker = ssh.CertChecker{IsAuthority: srv.isHostAuthority}
	srv.userCertChecker = ssh.CertChecker{IsAuthority: srv.isUserAuthority}
	srv.srv = s
	return srv, nil
}
// NewServer creates and returns a reverse tunnel server which is fully
// initialized but hasn't been started yet
NewServer creates and returns a reverse tunnel server which is fully
initialized but hasn't been started yet
// NewServer creates and returns a reverse tunnel server which is fully // initialized but hasn ' t been started yet
func NewServer(addr utils.NetAddr, hostSigners []ssh.Signer,
	authAPI auth.AccessPoint, opts ...ServerOption) (Server, error) {
	srv := &server{
		directSites: []*directSite{},
		tunnelSites: []*tunnelSite{},
		localAuth:   authAPI,
	}
	var err error
	srv.limiter, err = limiter.NewLimiter(limiter.LimiterConfig{})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	for _, o := range opts {
		o(srv)
	}
	if srv.timeout == 0 {
		srv.timeout = teleport.DefaultTimeout
	}
	s, err := sshutils.NewServer(
		teleport.ComponentReverseTunnel,
		addr,
		srv,
		hostSigners,
		sshutils.AuthMethods{
			PublicKey: srv.keyAuth,
		},
		sshutils.SetLimiter(srv.limiter),
	)
	if err != nil {
		return nil, err
	}
	srv.hostCertChecker = ssh.CertChecker{IsAuthority: srv.isHostAuthority}
	srv.userCertChecker = ssh.CertChecker{IsAuthority: srv.isUserAuthority}
	srv.srv = s
	return srv, nil
}
func NewServer ( addr utils . NetAddr , hostSigners [ ] ssh . Signer , authAPI auth . AccessPoint , opts ... ServerOption ) ( Server , error ) { srv := & server { directSites : [ ] * directSite { } , tunnelSites : [ ] * tunnelSite { } , localAuth : authAPI , } var err error srv . limiter , err = limiter . NewLimiter ( limiter . LimiterConfig { } ) if err != nil { return nil , trace . Wrap ( err ) } for _ , o := range opts { o ( srv ) } if srv . timeout == 0 { srv . timeout = teleport . DefaultTimeout } s , err := sshutils . NewServer ( teleport . ComponentReverseTunnel , addr , srv , hostSigners , sshutils . AuthMethods { PublicKey : srv . keyAuth , } , sshutils . SetLimiter ( srv . limiter ) , ) if err != nil { return nil , err } srv . hostCertChecker = ssh . CertChecker { IsAuthority : srv . isHostAuthority } srv . userCertChecker = ssh . CertChecker { IsAuthority : srv . isUserAuthority } srv . srv = s return srv , nil }
NewServer creates and returns a reverse tunnel server which is fully
initialized but hasn't been started yet
NewServer creates and returns a reverse tunnel server which is fully initialized but hasn ' t been started yet