modify: 根据Clash筛选返回配置中的节点类型

This commit is contained in:
2023-09-16 21:46:59 +08:00
parent 3318f5f2db
commit 918521682c
8 changed files with 58 additions and 20 deletions

View File

@ -29,12 +29,18 @@ func GetContryName(proxy model.Proxy) string {
}
func AddProxy(
sub *model.Subscription, autotest bool, lazy bool, sortStrategy string,
proxies ...model.Proxy,
sub *model.Subscription, autotest bool,
lazy bool, sortStrategy string,
clashType model.ClashType, proxies ...model.Proxy,
) {
newCountryGroupNames := make([]string, 0)
proxyTypes := model.GetSupportProxyTypes(clashType)
// 添加节点
for _, proxy := range proxies {
if !proxyTypes[proxy.Type] {
continue
}
sub.Proxies = append(sub.Proxies, proxy)
haveProxyGroup := false
countryName := GetContryName(proxy)