sentinel.go
func (s *Sentinel) HTTP(listener net.Listener, handler http.Handler, opts ...ServerOption) error {
	s.Lock()
	defer s.Unlock()

	if s.started {
		return ErrAlreadyStarted
	}

	var err error

	// create server and apply options
	server := &http.Server{
		Handler: handler,
	}
	for _, o := range opts {
		if err = o(server); err != nil {
			return err
		}
	}

	// register server
	return s.Register(func() error {
		return server.Serve(listener)
	}, server.Shutdown, IgnoreServerClosed, IgnoreNetOpError)
}
func (s *Sentinel) HTTP(listener net.Listener, handler http.Handler, opts ...ServerOption) error {
	s.Lock()
	defer s.Unlock()

	if s.started {
		return ErrAlreadyStarted
	}

	var err error

	// create server and apply options
	server := &http.Server{
		Handler: handler,
	}
	for _, o := range opts {
		if err = o(server); err != nil {
			return err
		}
	}

	// register server
	return s.Register(func() error {
		return server.Serve(listener)
	}, server.Shutdown, IgnoreServerClosed, IgnoreNetOpError)
}
// HTTP creates a HTTP server and registers it with the sentinel.