config: change checkduration to checkinterval

This commit is contained in:
nadoo 2019-01-06 21:01:20 +08:00
parent c89d6018cf
commit 47547bb08d
16 changed files with 20 additions and 22 deletions

View File

@ -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")

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -14,7 +14,7 @@ forward=http://1.1.1.1:8080
strategy=rr
checkwebsite=www.apple.com
checkduration=30
checkinterval=30
# NOTE HERE:

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -13,4 +13,4 @@ dnsserver=8.8.8.8:53
strategy=rr
checkwebsite=www.apple.com
checkduration=30
checkinterval=30

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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")