Skip to content

Commit

Permalink
fix: delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Larvan2 authored and Paulgudring committed Feb 9, 2024
1 parent 38e6d83 commit 05c4d27
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions core/src/main/golang/native/tunnel/proxies.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,20 @@ func convertProxies(proxies []C.Proxy, uiSubtitlePattern *regexp2.Regexp) []*Pro
}
}
}
testURL := "https://www.gstatic.com/generate_204"
for k := range p.ExtraDelayHistories() {
if len(k) > 0 {
testURL = k
break
}
}

result = append(result, &Proxy{
Name: name,
Title: strings.TrimSpace(title),
Subtitle: strings.TrimSpace(subtitle),
Type: p.Type().String(),
Delay: int(p.LastDelayForTestUrl("https://www.apple.com/library/test/success.html")),
Delay: int(p.LastDelayForTestUrl(testURL)),
})
}
return result
Expand All @@ -213,12 +220,20 @@ func collectProviders(providers []provider.ProxyProvider, uiSubtitlePattern *reg
}
}

testURL := "https://www.gstatic.com/generate_204"
for k := range px.ExtraDelayHistories() {
if len(k) > 0 {
testURL = k
break
}
}

result = append(result, &Proxy{
Name: name,
Title: strings.TrimSpace(title),
Subtitle: strings.TrimSpace(subtitle),
Type: px.Type().String(),
Delay: int(px.LastDelayForTestUrl("https://www.apple.com/library/test/success.html")),
Delay: int(px.LastDelayForTestUrl(testURL)),
})
}
}
Expand Down

0 comments on commit 05c4d27

Please sign in to comment.