clash/adapter/outboundgroup/common.go

25 lines
497 B
Go
Raw Normal View History

package outboundgroup
import (
"time"
2021-06-10 14:05:56 +08:00
"github.com/Dreamacro/clash/adapter/provider"
C "github.com/Dreamacro/clash/constant"
)
const (
defaultGetProxiesDuration = time.Second * 5
)
func getProvidersProxies(providers []provider.ProxyProvider, touch bool) []C.Proxy {
proxies := []C.Proxy{}
for _, provider := range providers {
if touch {
proxies = append(proxies, provider.ProxiesWithTouch()...)
} else {
proxies = append(proxies, provider.Proxies()...)
}
}
return proxies
}