[test]Add name filter to proxy group

This commit is contained in:
Clash-Mini
2022-01-05 12:19:49 +08:00
parent a15d2535f1
commit bfb976bbdc
7 changed files with 36 additions and 8 deletions

View File

@ -27,6 +27,7 @@ type URLTest struct {
tolerance uint16
disableUDP bool
fastNode C.Proxy
filter string
single *singledo.Single
fastSingle *singledo.Single
providers []provider.ProxyProvider
@ -73,7 +74,7 @@ func (u *URLTest) Unwrap(metadata *C.Metadata) C.Proxy {
func (u *URLTest) proxies(touch bool) []C.Proxy {
elm, _, _ := u.single.Do(func() (interface{}, error) {
return getProvidersProxies(u.providers, touch), nil
return getProvidersProxies(u.providers, touch, u.filter), nil
})
return elm.([]C.Proxy)
@ -184,6 +185,7 @@ func NewURLTest(option *GroupCommonOption, providers []provider.ProxyProvider, o
fastSingle: singledo.NewSingle(time.Second * 10),
providers: providers,
disableUDP: option.DisableUDP,
filter: option.Filter,
failedTimes: atomic.NewInt32(-1),
failedTime: atomic.NewInt64(-1),
}