Use HTTPS URLTest source

This commit is contained in:
世界
2023-04-13 09:03:08 +08:00
parent be00e19162
commit c6fc411164
7 changed files with 26 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"net/http"
"strconv"
"strings"
"sync"
"time"
@@ -67,6 +68,9 @@ func getGroupDelay(server *Server) func(w http.ResponseWriter, r *http.Request)
query := r.URL.Query()
url := query.Get("url")
if strings.HasPrefix(url, "http://") {
url = ""
}
timeout, err := strconv.ParseInt(query.Get("timeout"), 10, 32)
if err != nil {
render.Status(r, http.StatusBadRequest)

View File

@@ -6,6 +6,7 @@ import (
"net/http"
"sort"
"strconv"
"strings"
"time"
"github.com/sagernet/sing-box/adapter"
@@ -214,6 +215,9 @@ func getProxyDelay(server *Server) func(w http.ResponseWriter, r *http.Request)
return func(w http.ResponseWriter, r *http.Request) {
query := r.URL.Query()
url := query.Get("url")
if strings.HasPrefix(url, "http://") {
url = ""
}
timeout, err := strconv.ParseInt(query.Get("timeout"), 10, 16)
if err != nil {
render.Status(r, http.StatusBadRequest)