code: func ListenAndServe(config Config, handler http.Handler) (srv *http.Server, err error) {
  	server := &http.Server{
  		Addr:              config.Endpoint,
  		ReadTimeout:       config.ReadTimeout,
  		ReadHeaderTimeout: config.ReadHeaderTimeout,
  		WriteTimeout:      config.WriteTimeout,
  		IdleTimeout:       config.IdleTimeout,
  		MaxHeaderBytes:    config.MaxHeaderBytes,
  		Handler:           handler,
  	}
  
  	if len(config.ClientCerts) > 0 {
  		// require client certificate
  		caCertPool := x509.NewCertPool()
  
  		for _, c := range config.ClientCerts {
  			caCert, err := ioutil.ReadFile(c)
  			if err != nil {
  				return nil, err
  			}
  			caCertPool.AppendCertsFromPEM(caCert)
  		}
  
  		server.TLSConfig = &tls.Config{
  			ClientAuth: tls.RequireAndVerifyClientCert,
  			ClientCAs:  caCertPool,
  		}
  	}
  
  	ln, err := net.Listen("tcp", server.Addr)
  	if err != nil {
  		return nil, err
  	}
  	l := tcpKeepAliveListener{ln.(*net.TCPListener)}
  
  	go func() {
  		var err error
  		if config.UseHTTPS() {
  			// if server certificate and key is configured use HTTPS
  			err = server.ServeTLS(l, config.ServerCertfile, config.ServerKeyfile)
  		} else {
  			err = server.Serve(l)
  		}
  		// Serve always returns non-nil error
  		logging.DefaultLogger.Debugf("HTTP server Serve: %v", err)
  	}()
  
  	return server, nil
  }
docs: // ListenAndServe starts a http server.