From 98ef93c7bb9f7d4cec0a366f8666fac20e8b00f7 Mon Sep 17 00:00:00 2001 From: Nite07 Date: Tue, 8 Oct 2024 10:05:13 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20#42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/handler/default.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/handler/default.go b/api/handler/default.go index dfeff91..2a3dfb3 100644 --- a/api/handler/default.go +++ b/api/handler/default.go @@ -119,7 +119,10 @@ func BuildSub(clashType model.ClashType, query validator.SubValidator, template proxies := make(map[string]*model.Proxy) newProxies := make([]model.Proxy, 0, len(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 { proxies[key] = &proxyList[i] newProxies = append(newProxies, proxyList[i])