Feature: support proxy-group in relay (#597)

This commit is contained in:
duama
2020-05-07 21:42:52 +08:00
committed by GitHub
parent b979ff0bc2
commit 752f87a8dc
8 changed files with 52 additions and 22 deletions

View File

@ -67,6 +67,10 @@ func (s *Selector) Set(name string) error {
return errors.New("Proxy does not exist")
}
func (s *Selector) Unwrap(metadata *C.Metadata) C.Proxy {
return s.selectedProxy()
}
func (s *Selector) selectedProxy() C.Proxy {
elm, _, _ := s.single.Do(func() (interface{}, error) {
proxies := getProvidersProxies(s.providers)