1
0
mirror of https://github.com/nitezs/sub2clash.git synced 2024-12-23 15:04:41 -05:00
This commit is contained in:
Nite07 2024-10-08 10:05:13 +08:00
parent 6e09c44d17
commit 98ef93c7bb

View File

@ -119,7 +119,10 @@ func BuildSub(clashType model.ClashType, query validator.SubValidator, template
proxies := make(map[string]*model.Proxy) proxies := make(map[string]*model.Proxy)
newProxies := make([]model.Proxy, 0, len(proxyList)) newProxies := make([]model.Proxy, 0, len(proxyList))
for i := range proxyList { for i := range proxyList {
key := proxyList[i].Name + proxyList[i].Server + strconv.Itoa(proxyList[i].Port) + proxyList[i].Type + proxyList[i].UUID + proxyList[i].Password key := proxyList[i].Server + strconv.Itoa(proxyList[i].Port) + proxyList[i].Type + proxyList[i].UUID + proxyList[i].Password
if proxyList[i].Network == "ws" {
key += proxyList[i].WSOpts.Path + proxyList[i].WSOpts.Headers["Host"]
}
if _, exist := proxies[key]; !exist { if _, exist := proxies[key]; !exist {
proxies[key] = &proxyList[i] proxies[key] = &proxyList[i]
newProxies = append(newProxies, proxyList[i]) newProxies = append(newProxies, proxyList[i])