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