func (p *Proxy) startListener(name string, l *proxy.Listener) error {
	p.logger.Printf("[INFO] %s starting on %s", name, l.BindAddr())
	go func() {
		if err := l.Serve(); 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
}
// startPublicListener is run from the internal state machine loop
startPublicListener is run from the internal state machine loop
// startPublicListener is run from the internal state machine loop
func (p *Proxy) startListener(name string, l *proxy.Listener) error {
	p.logger.Printf("[INFO] %s starting on %s", name, l.BindAddr())
	go func() {
		if err := l.Serve(); 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
}
func ( p * Proxy ) startListener ( name string , l * proxy . Listener ) error { p . logger . Printf ( " " , name , l . BindAddr ( ) ) go func ( ) { if err := l . Serve ( ) ; err != nil { p . logger . Printf ( " " , name , err ) return } p . logger . Printf ( " " , name ) } ( ) go func ( ) { <- p . stopChan l . Close ( ) } ( ) return nil }
startPublicListener is run from the internal state machine loop
startPublicListener is run from the internal state machine loop