Refactor: allow to add an empty proxy provider to proxy group

This commit is contained in:
yaling888
2022-06-22 04:36:27 +08:00
parent e31be4edc2
commit 1f12ef069b
7 changed files with 76 additions and 48 deletions

View File

@@ -415,11 +415,11 @@ func parseProxies(cfg *RawConfig) (proxies map[string]C.Proxy, providersMap map[
// keep the original order of ProxyGroups in config file
for idx, mapping := range groupsConfig {
groupName, existName := mapping["name"].(string)
groupName, existName := mapping["name"]
if !existName {
return nil, nil, fmt.Errorf("proxy group %d: missing name", idx)
}
proxyList = append(proxyList, groupName)
proxyList = append(proxyList, groupName.(string))
}
// check if any loop exists and sort the ProxyGroups