mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
config: change checkduration to checkinterval
This commit is contained in:
parent
c89d6018cf
commit
47547bb08d
@ -117,7 +117,7 @@ glider -config CONFIGPATH -listen :8080 -verbose
|
||||
|
||||
```bash
|
||||
glider v0.6.10 usage:
|
||||
-checkduration int
|
||||
-checkinterval int
|
||||
proxy check interval(seconds) (default 30)
|
||||
-checkwebsite string
|
||||
proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80 (default "www.apple.com")
|
||||
|
3
conf.go
3
conf.go
@ -39,8 +39,7 @@ func confInit() {
|
||||
flag.StringSliceUniqVar(&conf.Forward, "forward", nil, "forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]")
|
||||
flag.StringVar(&conf.StrategyConfig.Strategy, "strategy", "rr", "forward strategy, default: rr")
|
||||
flag.StringVar(&conf.StrategyConfig.CheckWebSite, "checkwebsite", "www.apple.com", "proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80")
|
||||
// TODO: change to checkinterval
|
||||
flag.IntVar(&conf.StrategyConfig.CheckInterval, "checkduration", 30, "proxy check interval(seconds)")
|
||||
flag.IntVar(&conf.StrategyConfig.CheckInterval, "checkinterval", 30, "proxy check interval(seconds)")
|
||||
flag.IntVar(&conf.StrategyConfig.MaxFailures, "maxfailures", 3, "max failures to change forwarder status to disabled")
|
||||
flag.StringVar(&conf.StrategyConfig.IntFace, "interface", "", "source ip or source interface")
|
||||
|
||||
|
@ -31,8 +31,8 @@ strategy=rr
|
||||
# MUST be a HTTP website server address, format: HOST[:PORT]. HTTPS NOT SUPPORTED.
|
||||
checkwebsite=www.apple.com
|
||||
|
||||
# check duration
|
||||
checkduration=30
|
||||
# check interval
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# Setup a dns forwarding server
|
||||
@ -58,7 +58,7 @@ forward=ss://method:pass@1.1.1.1:8443
|
||||
forward=http://192.168.2.1:8080,socks5://192.168.2.2:1080
|
||||
strategy=rr
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
# DNS SERVER for domains in this rule file
|
||||
dnsserver=208.67.222.222:53
|
||||
|
@ -17,5 +17,5 @@ strategy=rr
|
||||
# MUST be a HTTP website server address, format: HOST[:PORT]. HTTPS NOT SUPPORTED.
|
||||
checkwebsite=www.apple.com
|
||||
|
||||
# check duration(seconds)
|
||||
checkduration=30
|
||||
# check interval(seconds)
|
||||
checkinterval=30
|
||||
|
@ -9,7 +9,7 @@ forward=http://1.1.1.1:8080
|
||||
strategy=rr
|
||||
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# matches abc.com and *.abc.com
|
||||
|
@ -14,7 +14,7 @@ forward=http://1.1.1.1:8080
|
||||
strategy=rr
|
||||
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# NOTE HERE:
|
||||
|
@ -11,7 +11,7 @@ forward=http://forwarder5:8080,socks6://forwarder3:1080
|
||||
strategy=rr
|
||||
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# matches 192.168.0.0/16
|
||||
|
@ -11,7 +11,7 @@ forward=http://forwarder2:8080,socks5://forwarder3:1080
|
||||
strategy=rr
|
||||
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# matches 172.16.0.0/24
|
||||
|
@ -12,7 +12,7 @@ dns=:5353
|
||||
dnsserver=8.8.8.8:53
|
||||
strategy=rr
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
```
|
||||
|
||||
#### Create a ipset manually
|
||||
|
@ -13,4 +13,4 @@ dnsserver=8.8.8.8:53
|
||||
|
||||
strategy=rr
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
@ -38,7 +38,7 @@ forward=http://forwarder1:8080,socks5://forwarder2:1080
|
||||
forward=http://1.1.1.1:8080
|
||||
strategy=rr
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
# specify a different dns server(if need)
|
||||
dnsserver=208.67.222.222:53
|
||||
|
@ -11,7 +11,7 @@ forward=http://forwarder5:8080,socks5://forwarder3:1080
|
||||
strategy=rr
|
||||
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
# as a ipset manager
|
||||
ipset=glider
|
||||
|
@ -10,7 +10,7 @@ forward=http://forwarder2:8080,socks5://forwarder3:1080
|
||||
# High Availability mode: ha
|
||||
strategy=rr
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
# specify a different dns server(if need)
|
||||
dnsserver=208.67.222.222:53
|
||||
|
@ -152,8 +152,8 @@ strategy=rr
|
||||
# MUST be a HTTP website server address, format: HOST[:PORT]. HTTPS NOT SUPPORTED.
|
||||
checkwebsite=www.apple.com
|
||||
|
||||
# check duration(seconds)
|
||||
checkduration=30
|
||||
# check interval(seconds)
|
||||
checkinterval=30
|
||||
|
||||
|
||||
# DNS FORWARDING SERVER
|
||||
|
@ -15,7 +15,7 @@ strategy=rr
|
||||
|
||||
# FORWARDER CHECK SETTINGS
|
||||
checkwebsite=www.apple.com
|
||||
checkduration=30
|
||||
checkinterval=30
|
||||
|
||||
# DNS SERVER for domains in this rule file
|
||||
dnsserver=208.67.222.222:53
|
||||
|
@ -34,8 +34,7 @@ func NewConfFromFile(ruleFile string) (*Config, error) {
|
||||
f.StringSliceUniqVar(&p.Forward, "forward", nil, "forward url, format: SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS[,SCHEME://[USER|METHOD:PASSWORD@][HOST]:PORT?PARAMS]")
|
||||
f.StringVar(&p.StrategyConfig.Strategy, "strategy", "rr", "forward strategy, default: rr")
|
||||
f.StringVar(&p.StrategyConfig.CheckWebSite, "checkwebsite", "www.apple.com", "proxy check HTTP(NOT HTTPS) website address, format: HOST[:PORT], default port: 80")
|
||||
// TODO: change to checkinterval
|
||||
f.IntVar(&p.StrategyConfig.CheckInterval, "checkduration", 30, "proxy check interval(seconds)")
|
||||
f.IntVar(&p.StrategyConfig.CheckInterval, "checkinterval", 30, "proxy check interval(seconds)")
|
||||
f.StringVar(&p.StrategyConfig.IntFace, "interface", "", "source ip or source interface")
|
||||
|
||||
f.StringSliceUniqVar(&p.DNSServers, "dnsserver", nil, "remote dns server")
|
||||
|
Loading…
Reference in New Issue
Block a user