Skip to content

Commit

Permalink
revert: "modify default url"
Browse files Browse the repository at this point in the history
This reverts commit 3d643cb.
  • Loading branch information
Larvan2 committed Feb 21, 2024
1 parent f8295a0 commit a37548c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions adapter/outboundgroup/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
groupOption.ExpectedStatus = status
testUrl := groupOption.URL

if groupOption.Type != "select" && groupOption.Type != "relay" {
if groupOption.URL == "" {
groupOption.URL = C.DefaultTestURL
testUrl = groupOption.URL
}
}

if len(GroupProxies) != 0 {
ps, err := getProxies(proxyMap, GroupProxies)
if err != nil {
Expand All @@ -115,6 +108,10 @@ func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, provide
if groupOption.Interval == 0 {
groupOption.Interval = 300
}
if groupOption.URL == "" {
groupOption.URL = C.DefaultTestURL
testUrl = groupOption.URL
}
}

hc := provider.NewHealthCheck(ps, testUrl, uint(groupOption.TestTimeout), uint(groupOption.Interval), groupOption.Lazy, expectedStatus)
Expand Down
4 changes: 2 additions & 2 deletions adapter/provider/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ func (hc *HealthCheck) close() {

func NewHealthCheck(proxies []C.Proxy, url string, timeout uint, interval uint, lazy bool, expectedStatus utils.IntRanges[uint16]) *HealthCheck {
if url == "" {
// expectedStatus = nil
url = C.DefaultTestURL
expectedStatus = nil
interval = 0
}
if timeout == 0 {
timeout = 5000
Expand Down

0 comments on commit a37548c

Please sign in to comment.