code: func (s *Server) Listeners() ([]Loop, error) {
  	loops := []Loop{}
  	for _, addr := range s.addrs {
  		parsedURL, err := parseURL(addr, s.cert != nil)
  		if err != nil {
  			return nil, err
  		}
  		var loop Loop
  		var listener httpListener
  		switch parsedURL.Scheme {
  		case "unix":
  			loop, listener, err = s.getListenerForUNIXSocket(parsedURL)
  		case "http":
  			loop, listener, err = s.getListenerForHTTPServer(parsedURL)
  		case "https":
  			loop, listener, err = s.getListenerForHTTPSServer(parsedURL)
  		default:
  			err = fmt.Errorf("invalid url scheme %q", parsedURL.Scheme)
  		}
  		if err != nil {
  			return nil, err
  		}
  		s.httpListeners = append(s.httpListeners, listener)
  		loops = append(loops, loop)
  	}
  
  	if s.insecureAddr != "" {
  		parsedURL, err := parseURL(s.insecureAddr, false)
  		if err != nil {
  			return nil, err
  		}
  		loop, httpListener, err := s.getListenerForHTTPServer(parsedURL)
  		if err != nil {
  			return nil, err
  		}
  		s.httpListeners = append(s.httpListeners, httpListener)
  		loops = append(loops, loop)
  	}
  
  	return loops, nil
  }
docs: // Listeners returns functions that listen and serve connections.