diff --git a/adapter/outboundgroup/fallback.go b/adapter/outboundgroup/fallback.go index 50427e53a8..488c2d342a 100644 --- a/adapter/outboundgroup/fallback.go +++ b/adapter/outboundgroup/fallback.go @@ -89,6 +89,7 @@ func (f *Fallback) MarshalJSON() ([]byte, error) { "all": all, "testUrl": f.testUrl, "expectedStatus": f.expectedStatus, + "fixed": f.selected, }) } diff --git a/adapter/outboundgroup/urltest.go b/adapter/outboundgroup/urltest.go index 29d749f9be..8dcf674c9f 100644 --- a/adapter/outboundgroup/urltest.go +++ b/adapter/outboundgroup/urltest.go @@ -170,6 +170,7 @@ func (u *URLTest) MarshalJSON() ([]byte, error) { "all": all, "testUrl": u.testUrl, "expectedStatus": u.expectedStatus, + "fixed": u.selected, }) } diff --git a/hub/route/groups.go b/hub/route/groups.go index e36b8ab04d..18aabf74b2 100644 --- a/hub/route/groups.go +++ b/hub/route/groups.go @@ -2,15 +2,17 @@ package route import ( "context" - "github.com/go-chi/chi/v5" - "github.com/go-chi/render" "net/http" "strconv" "time" + "github.com/go-chi/chi/v5" + "github.com/go-chi/render" + "github.com/metacubex/mihomo/adapter" "github.com/metacubex/mihomo/adapter/outboundgroup" "github.com/metacubex/mihomo/common/utils" + "github.com/metacubex/mihomo/component/profile/cachefile" C "github.com/metacubex/mihomo/constant" "github.com/metacubex/mihomo/tunnel" ) @@ -63,6 +65,10 @@ func getGroupDelay(w http.ResponseWriter, r *http.Request) { URLTestGroup.ForceSet("") } + if proxy.(*adapter.Proxy).Type() != C.Selector { + cachefile.Cache().SetSelected(proxy.Name(), "") + } + query := r.URL.Query() url := query.Get("url") timeout, err := strconv.ParseInt(query.Get("timeout"), 10, 32)