2019-12-10 15:04:22 +08:00
|
|
|
package outboundgroup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/Dreamacro/clash/adapters/provider"
|
|
|
|
C "github.com/Dreamacro/clash/constant"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
defaultGetProxiesDuration = time.Second * 5
|
|
|
|
)
|
|
|
|
|
2020-11-19 00:53:22 +08:00
|
|
|
func getProvidersProxies(providers []provider.ProxyProvider, touch bool) []C.Proxy {
|
2019-12-10 15:04:22 +08:00
|
|
|
proxies := []C.Proxy{}
|
|
|
|
for _, provider := range providers {
|
2020-11-19 00:53:22 +08:00
|
|
|
if touch {
|
|
|
|
proxies = append(proxies, provider.ProxiesWithTouch()...)
|
|
|
|
} else {
|
|
|
|
proxies = append(proxies, provider.Proxies()...)
|
|
|
|
}
|
2019-12-10 15:04:22 +08:00
|
|
|
}
|
|
|
|
return proxies
|
|
|
|
}
|