Documentation ¶
Index ¶
- Variables
- func CleanBadProxiesWithGrpool(proxies []proxy.Proxy) (cproxies []proxy.Proxy)
- func HTTPGetBodyForSpeedTest(clashProxy C.Proxy, url string, t time.Duration) error
- func HTTPGetBodyViaProxy(clashProxy C.Proxy, url string) ([]byte, error)
- func HTTPGetViaProxy(clashProxy C.Proxy, url string) error
- func HTTPHeadViaProxy(clashProxy C.Proxy, url string) error
- func ProxySpeedTest(p proxy.Proxy) (speedResult float64, err error)
- func SpeedTestAll(proxies []proxy.Proxy, conns int)
- func SpeedTestNew(proxies []proxy.Proxy, conns int)
- type ByDistance
- type Server
- type ServerList
- type Servers
- type Stat
- type StatList
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
View Source
var SpeedTimeout = time.Second * 10
Functions ¶
func HTTPGetBodyForSpeedTest ¶
func ProxySpeedTest ¶
ProxySpeedTest returns a speed result of a proxy. The speed result is like 20Mbit/s. -1 for error.
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 ByDistance ¶
type ByDistance struct {
Servers
}
ByDistance : For sorting servers.
func (ByDistance) Less ¶
func (b ByDistance) Less(i, j int) bool
Less : compare the distance. For sorting servers.
type Server ¶
type Server struct { URL string `xml:"url,attr"` Lat string `xml:"lat,attr"` Lon string `xml:"lon,attr"` Name string `xml:"name,attr"` Country string `xml:"country,attr"` Sponsor string `xml:"sponsor,attr"` ID string `xml:"id,attr"` URL2 string `xml:"url2,attr"` Host string `xml:"host,attr"` Distance float64 DLSpeed float64 }
Server information
type ServerList ¶
type ServerList struct {
Servers []Server `xml:"servers>server"`
}
ServerList : List of Server. for xml decoding
type Servers ¶
type Servers []Server
Servers : For sorting servers.
type StatList ¶
type StatList []Stat
Statistic array for proxies
var ProxyStats StatList
ProxyStats stores proxies' statistics
func (StatList) ReqCountThan ¶
Return proxies that request count more than a given nubmer
Click to show internal directories.
Click to hide internal directories.