tls,trojan: optimize the default port handling

This commit is contained in:
nadoo committed 2021-03-21 00:08:00 +08:00
1 parent 93728c6378
commit 2d16870803
6 files changed
+17 -19

No files matched your search

+3 -3
View File
@@ -189,13 +189,13 @@ func (p *FwdrGroup) Check() {
u, err := url.Parse(p.config.Check)
if err != nil {
log.F("[group] parse check config error: %s", err)
log.F("[group] parse check config error: %s, disable health checking", err)
return
}
addr := u.Host
if strings.IndexByte(addr, ':') == -1 {
addr += ":80"
if _, p, _ := net.SplitHostPort(addr); p == "" {
addr = net.JoinHostPort(addr, "80")
}
timeout := time.Duration(p.config.CheckTimeout) * time.Second