diff --git a/services/http/http.go b/services/http/http.go index 73dd4b5..efdde0d 100644 --- a/services/http/http.go +++ b/services/http/http.go @@ -189,7 +189,9 @@ func (s *HTTP) StopService() { } }() s.isStop = true - s.checker.Stop() + if *s.cfg.Parent != "" { + s.checker.Stop() + } if s.sshClient != nil { s.sshClient.Close() } diff --git a/services/socks/socks.go b/services/socks/socks.go index 901e001..0eca018 100644 --- a/services/socks/socks.go +++ b/services/socks/socks.go @@ -146,7 +146,9 @@ func (s *Socks) InitService() (err error) { if *s.cfg.DNSAddress != "" { (*s).domainResolver = utils.NewDomainResolver(*s.cfg.DNSAddress, *s.cfg.DNSTTL, s.log) } - s.checker = utils.NewChecker(*s.cfg.Timeout, int64(*s.cfg.Interval), *s.cfg.Blocked, *s.cfg.Direct, s.log) + if *s.cfg.Parent != "" { + s.checker = utils.NewChecker(*s.cfg.Timeout, int64(*s.cfg.Interval), *s.cfg.Blocked, *s.cfg.Direct, s.log) + } if *s.cfg.ParentType == "ssh" { e := s.ConnectSSH() if e != nil { @@ -193,7 +195,9 @@ func (s *Socks) StopService() { } }() s.isStop = true - s.checker.Stop() + if *s.cfg.Parent != "" { + s.checker.Stop() + } if s.sshClient != nil { s.sshClient.Close() }