v6.6
This commit is contained in:
@ -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()
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user