Feature: allow arbitrary order in proxy group (#89)

This commit is contained in:
Comzyh
2019-08-12 10:11:44 +08:00
committed by Dreamacro
parent b137a50d85
commit d59e98dc83
2 changed files with 129 additions and 1 deletions

View File

@ -293,10 +293,13 @@ func parseProxies(cfg *rawConfig) (map[string]C.Proxy, error) {
}
// parse proxy group
if err := proxyGroupsDagSort(groupsConfig); err != nil {
return nil, err
}
for idx, mapping := range groupsConfig {
groupType, existType := mapping["type"].(string)
groupName, existName := mapping["name"].(string)
if !existType && existName {
if !(existType && existName) {
return nil, fmt.Errorf("ProxyGroup %d: missing type or name", idx)
}