func New(client *api.Client, cw ConfigWatcher, logger *log.Logger) (*Proxy, error) {
	return &Proxy{
		client:      client,
		cfgWatcher:  cw,
		stopChan:    make(chan struct{}),
		logger:      logger,
		services:    make(map[string]*connect.Service),
		proxyStates: make(map[string]*proxyState),
	}, nil
}
// New returns a proxy with the given configuration source.
//
// The ConfigWatcher can be used to update the configuration of the proxy.
// Whenever a new configuration is detected, the proxy will reconfigure itself.
New returns a proxy with the given configuration source.

The ConfigWatcher can be used to update the configuration of the proxy.
Whenever a new configuration is detected, the proxy will reconfigure itself.
// New returns a proxy with the given configuration source . // // The ConfigWatcher can be used to update the configuration of the proxy . // Whenever a new configuration is detected the proxy will reconfigure itself .
func New(client *api.Client, cw ConfigWatcher, logger *log.Logger) (*Proxy, error) {
	return &Proxy{
		client:      client,
		cfgWatcher:  cw,
		stopChan:    make(chan struct{}),
		logger:      logger,
		services:    make(map[string]*connect.Service),
		proxyStates: make(map[string]*proxyState),
	}, nil
}
func New ( client * api . Client , cw ConfigWatcher , logger * log . Logger ) ( * Proxy , error ) { return & Proxy { client : client , cfgWatcher : cw , stopChan : make ( chan struct { } ) , logger : logger , services : make ( map [ string ] * connect . Service ) , proxyStates : make ( map [ string ] * proxyState ) , } , nil }
New returns a proxy with the given configuration source.
New returns a proxy with the given configuration source .