func (p *Proxy) Serve() error {
	for {
		select {
		case cfg := <-p.cfgWatcher.Watch():
			p.logger.Printf("[DEBUG] got new config")
			for id, config := range cfg.proxyConfigs {
				p.runServiceProxy(id, config)
			}
			p.removeNotPresent(cfg.proxyConfigs)
		case <-p.stopChan:
			return nil
		}
	}
}
// Serve the proxy instance until a fatal error occurs or proxy is closed.
Serve the proxy instance until a fatal error occurs or proxy is closed.
// Serve the proxy instance until a fatal error occurs or proxy is closed .
func (p *Proxy) Serve() error {
	for {
		select {
		case cfg := <-p.cfgWatcher.Watch():
			p.logger.Printf("[DEBUG] got new config")
			for id, config := range cfg.proxyConfigs {
				p.runServiceProxy(id, config)
			}
			p.removeNotPresent(cfg.proxyConfigs)
		case <-p.stopChan:
			return nil
		}
	}
}
func ( p * Proxy ) Serve ( ) error { for { select { case cfg := <- p . cfgWatcher . Watch ( ) : p . logger . Printf ( " " ) for id , config := range cfg . proxyConfigs { p . runServiceProxy ( id , config ) } p . removeNotPresent ( cfg . proxyConfigs ) case <- p . stopChan : return nil } } }
Serve the proxy instance until a fatal error occurs or proxy is closed.
Serve the proxy instance until a fatal error occurs or proxy is closed .