code: func (p *Proxy) startListener(name string, l *Listener) error {
  	p.logger.Printf("[INFO] %s starting on %s", name, l.BindAddr())
  	go func() {
  		err := l.Serve()
  		if err != nil {
  			p.logger.Printf("[ERR] %s stopped with error: %s", name, err)
  			return
  		}
  		p.logger.Printf("[INFO] %s stopped", name)
  	}()
  
  	go func() {
  		<-p.stopChan
  		l.Close()
  
  	}()
  
  	return nil
  }
docs: // startPublicListener is run from the internal state machine loop