diff --git a/core/server/test_utils.go b/core/server/test_utils.go index b0f6293..b5a2ab8 100644 --- a/core/server/test_utils.go +++ b/core/server/test_utils.go @@ -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{ diff --git a/src/configs/ConfigBuilder.cpp b/src/configs/ConfigBuilder.cpp index b449ab6..3abe728 100644 --- a/src/configs/ConfigBuilder.cpp +++ b/src/configs/ConfigBuilder.cpp @@ -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;