2019-12-10 15:04:22 +08:00
|
|
|
package outboundgroup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
C "github.com/Dreamacro/clash/constant"
|
2021-07-04 20:32:59 +08:00
|
|
|
"github.com/Dreamacro/clash/constant/provider"
|
2019-12-10 15:04:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
defaultGetProxiesDuration = time.Second * 5
|
|
|
|
)
|
|
|
|
|
2022-11-04 13:11:01 +08:00
|
|
|
func touchProviders(providers []provider.ProxyProvider) {
|
|
|
|
for _, provider := range providers {
|
|
|
|
provider.Touch()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {
|
2022-11-04 13:11:01 +08:00
|
|
|
provider.Touch()
|
2020-11-19 00:53:22 +08:00
|
|
|
}
|
2022-11-04 13:11:01 +08:00
|
|
|
proxies = append(proxies, provider.Proxies()...)
|
2019-12-10 15:04:22 +08:00
|
|
|
}
|
|
|
|
return proxies
|
|
|
|
}
|