This commit is contained in:
arraykeys@gmail.com
2018-11-30 10:16:11 +08:00
parent 442e7b7c01
commit 8c4e5025ed
3 changed files with 3 additions and 4 deletions

View File

@ -117,7 +117,7 @@ func initConfig() (err error) {
httpArgs.ParentKey = http.Flag("parent-key", "the password for auto encrypt/decrypt parent connection data").Short('Z').Default("").String()
httpArgs.LocalCompress = http.Flag("local-compress", "auto compress/decompress data on local connection").Short('m').Default("false").Bool()
httpArgs.ParentCompress = http.Flag("parent-compress", "auto compress/decompress data on parent connection").Short('M').Default("false").Bool()
httpArgs.CloseIntelligent = http.Flag("close-intelligent", "Close intelligent HTTP, SOCKS5 proxy").Default("false").Bool()
httpArgs.CloseIntelligent = http.Flag("close-intelligent", "close intelligent HTTP, SOCKS5 proxy").Default("false").Bool()
httpArgs.LoadBalanceMethod = http.Flag("lb-method", "load balance method when use multiple parent,can be <roundrobin|leastconn|leasttime|hash|weight>").Default("roundrobin").Enum("roundrobin", "weight", "leastconn", "leasttime", "hash")
httpArgs.LoadBalanceTimeout = http.Flag("lb-timeout", "tcp milliseconds timeout of connecting to parent").Default("500").Int()
httpArgs.LoadBalanceRetryTime = http.Flag("lb-retrytime", "sleep time milliseconds after checking").Default("1000").Int()

View File

@ -186,7 +186,6 @@ func (s *HTTP) InitService() (err error) {
s.InitBasicAuth()
//init lb
if len(*s.cfg.Parent) > 0 {
s.log.Printf("CloseIntelligent: %v", *s.cfg.CloseIntelligent)
s.checker = utils.NewChecker(*s.cfg.HTTPTimeout, int64(*s.cfg.Interval), *s.cfg.Blocked, *s.cfg.Direct, s.log, *s.cfg.CloseIntelligent)
s.InitLB()
}

View File

@ -44,13 +44,13 @@ type CheckerItem struct {
//NewChecker args:
//timeout : tcp timeout milliseconds ,connect to host
//interval: recheck domain interval seconds
func NewChecker(timeout int, interval int64, blockedFile, directFile string, log *logger.Logger, CloseIntelligent bool) Checker {
func NewChecker(timeout int, interval int64, blockedFile, directFile string, log *logger.Logger, closeIntelligent bool) Checker {
ch := Checker{
data: mapx.NewConcurrentMap(),
interval: interval,
timeout: timeout,
isStop: false,
closeIntelligent: CloseIntelligent,
closeIntelligent: closeIntelligent,
log: log,
}
ch.blockedMap = ch.loadMap(blockedFile)