Documentation ¶
Index ¶
- Variables
- func CleanBadProxies(proxies []proxy.Proxy) (cproxies []proxy.Proxy)
- func CleanBadProxiesWithGrpool(proxies []proxy.Proxy) (cproxies []proxy.Proxy)
- func HTTPGetBodyViaProxy(clashProxy C.Proxy, url string) ([]byte, error)
- func HTTPGetBodyViaProxyWithTime(clashProxy C.Proxy, url string, t time.Duration) ([]byte, error)
- func HTTPGetBodyViaProxyWithTimeNoReturn(clashProxy C.Proxy, url string, t time.Duration) error
- func HTTPGetViaProxy(clashProxy C.Proxy, url string) error
- func HTTPHeadViaProxy(clashProxy C.Proxy, url string) error
- func PingFromChina(host string, port string) (bool, time.Duration, error)
- func ProxySpeedTest(p proxy.Proxy) (speedResult float64, err error)
- func RelayCheck(proxies proxy.ProxyList)
- func SpeedTestAll(proxies []proxy.Proxy)
- func SpeedTestNew(proxies []proxy.Proxy)
- type Stat
- type StatList
Constants ¶
This section is empty.
Variables ¶
View Source
var DelayConn = 500
View Source
var DelayTimeout = defaultURLTestTimeout
View Source
var DownloadSize = 100
View Source
var RelayTimeout = defaultURLTestTimeout * 2
View Source
var SpeedConn = 5
View Source
var SpeedExist = false
View Source
var SpeedTimeout = time.Second * 10
Functions ¶
func HTTPGetBodyViaProxyWithTimeNoReturn ¶
Get body without return to save memory
func RelayCheck ¶
func SpeedTestAll ¶
SpeedTestAll tests speed of a group of proxies. Results are stored in ProxyStats
func SpeedTestNew ¶
SpeedTestNew tests speed of new proxies which is not in ProxyStats. Then appended to ProxyStats
Types ¶
type Stat ¶
type Stat struct { Speed float64 Delay time.Duration ReqCount uint16 Relay bool Pool bool OutIp string Id string }
Statistic for a proxy
func (*Stat) UpdatePSDelay ¶
Update delay for a Stat
Click to show internal directories.
Click to hide internal directories.