fix endpoints not being url tested

This commit is contained in:
Nova 2025-02-25 21:11:57 +03:30
parent 3179e37ab5
commit 4b3bb5f019
2 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ type URLTestResult struct {
func BatchURLTest(ctx context.Context, i *boxbox.Box, outboundTags []string, url string, maxConcurrency int, twice bool) []*URLTestResult {
outbounds := service.FromContext[adapter.OutboundManager](i.Context())
endpoints := service.FromContext[adapter.EndpointManager](i.Context())
resMap := make(map[string]*URLTestResult)
resAccess := sync.Mutex{}
limiter := make(chan struct{}, maxConcurrency)
@ -49,7 +50,10 @@ func BatchURLTest(ctx context.Context, i *boxbox.Box, outboundTags []string, url
defer wg.Done()
outbound, found := outbounds.Outbound(t)
if !found {
panic("no outbound with tag " + t + " found")
outbound, found = endpoints.Get(t)
if !found {
panic("no outbound with tag " + t + " found")
}
}
client := &http.Client{
Transport: &http.Transport{

View File

@ -161,6 +161,8 @@ namespace NekoGui {
results->error = QString("outbounds is empty for %1").arg(item->bean->name);
return results;
}
auto endpoints = res->coreConfig["endpoints"].toArray();
for (auto endpoint : endpoints) outbounds.append(endpoint);
for (const auto &outboundRef: outbounds) {
auto outbound = outboundRef.toObject();
if (outbound["tag"] == "direct" || outbound["tag"] == "block" || outbound["tag"] == "dns-out" || outbound["tag"].toString().startsWith("rout")) continue;