Skip to content

Commit

Permalink
fix: try fixing automatic policy
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Dec 25, 2023
1 parent 41a05d9 commit 0d07cf4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions adapter/outboundgroup/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (f *Fallback) MarshalJSON() ([]byte, error) {
"all": all,
"testUrl": f.testUrl,
"expectedStatus": f.expectedStatus,
"fixed": f.selected,
})
}

Expand Down
1 change: 1 addition & 0 deletions adapter/outboundgroup/urltest.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (u *URLTest) MarshalJSON() ([]byte, error) {
"all": all,
"testUrl": u.testUrl,
"expectedStatus": u.expectedStatus,
"fixed": u.selected,
})
}

Expand Down
10 changes: 8 additions & 2 deletions hub/route/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0d07cf4

Please sign in to comment.