chore: update quic-go to 0.57.1

This commit is contained in:
wwqgtxx
2025-12-17 16:13:12 +08:00
parent a06097c2c4
commit 1cab34d257
80 changed files with 383 additions and 543 deletions

View File

@@ -1,12 +1,11 @@
package route
import (
"net/http"
"github.com/metacubex/mihomo/component/resolver"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func cacheRouter() http.Handler {

View File

@@ -6,14 +6,15 @@ import (
"errors"
"io"
"net"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/go-chi/chi/v5"
N "github.com/metacubex/mihomo/common/net"
"github.com/metacubex/chi"
"github.com/metacubex/http"
)
// When name is composed of a partial escape string, Golang does not unescape it

View File

@@ -1,7 +1,6 @@
package route
import (
"net/http"
"net/netip"
"path/filepath"
@@ -18,8 +17,9 @@ import (
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/tunnel"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func configRouter() http.Handler {

View File

@@ -3,14 +3,14 @@ package route
import (
"bytes"
"encoding/json"
"net/http"
"strconv"
"time"
"github.com/metacubex/mihomo/tunnel/statistic"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func connectionRouter() http.Handler {

View File

@@ -3,12 +3,12 @@ package route
import (
"context"
"math"
"net/http"
"github.com/metacubex/mihomo/component/resolver"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
"github.com/miekg/dns"
"github.com/samber/lo"
)

View File

@@ -4,11 +4,11 @@ import (
"context"
"encoding/base64"
"io"
"net/http"
"github.com/metacubex/mihomo/component/resolver"
"github.com/go-chi/render"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func dohRouter() http.Handler {

View File

@@ -1,6 +1,6 @@
package route
import "github.com/go-chi/chi/v5"
import "github.com/metacubex/chi"
type externalRouter func(r chi.Router)

View File

@@ -2,18 +2,18 @@ package route
import (
"context"
"net/http"
"strconv"
"time"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"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"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func groupRouter() http.Handler {

View File

@@ -2,14 +2,14 @@ package route
import (
"context"
"net/http"
C "github.com/metacubex/mihomo/constant"
P "github.com/metacubex/mihomo/constant/provider"
"github.com/metacubex/mihomo/tunnel"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
"github.com/samber/lo"
)

View File

@@ -3,7 +3,6 @@ package route
import (
"context"
"fmt"
"net/http"
"strconv"
"time"
@@ -13,8 +12,9 @@ import (
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/tunnel"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
var (

View File

@@ -2,7 +2,6 @@ package route
import (
"fmt"
"net/http"
"os"
"os/exec"
"runtime"
@@ -11,8 +10,9 @@ import (
"github.com/metacubex/mihomo/hub/executor"
"github.com/metacubex/mihomo/log"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func restartRouter() http.Handler {

View File

@@ -2,12 +2,11 @@ package route
import (
"github.com/metacubex/mihomo/constant"
"net/http"
"github.com/metacubex/mihomo/tunnel"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func ruleRouter() http.Handler {

View File

@@ -5,7 +5,6 @@ import (
"crypto/subtle"
"encoding/json"
"net"
"net/http"
"os"
"path/filepath"
"runtime/debug"
@@ -17,16 +16,17 @@ import (
"github.com/metacubex/mihomo/common/utils"
"github.com/metacubex/mihomo/component/ca"
"github.com/metacubex/mihomo/component/ech"
tlsC "github.com/metacubex/mihomo/component/tls"
C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/log"
"github.com/metacubex/mihomo/ntp"
"github.com/metacubex/mihomo/tunnel/statistic"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/render"
"github.com/sagernet/cors"
"github.com/metacubex/chi"
"github.com/metacubex/chi/cors"
"github.com/metacubex/chi/middleware"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
"github.com/metacubex/tls"
)
var (
@@ -204,16 +204,16 @@ func startTLS(cfg *Config) {
}
log.Infoln("RESTful API tls listening at: %s", l.Addr().String())
tlsConfig := &tlsC.Config{Time: ntp.Now}
tlsConfig := &tls.Config{Time: ntp.Now}
tlsConfig.NextProtos = []string{"h2", "http/1.1"}
tlsConfig.Certificates = []tlsC.Certificate{tlsC.UCertificate(cert)}
tlsConfig.ClientAuth = tlsC.ClientAuthTypeFromString(cfg.ClientAuthType)
tlsConfig.Certificates = []tls.Certificate{cert}
tlsConfig.ClientAuth = ca.ClientAuthTypeFromString(cfg.ClientAuthType)
if len(cfg.ClientAuthCert) > 0 {
if tlsConfig.ClientAuth == tlsC.NoClientCert {
tlsConfig.ClientAuth = tlsC.RequireAndVerifyClientCert
if tlsConfig.ClientAuth == tls.NoClientCert {
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
}
}
if tlsConfig.ClientAuth == tlsC.VerifyClientCertIfGiven || tlsConfig.ClientAuth == tlsC.RequireAndVerifyClientCert {
if tlsConfig.ClientAuth == tls.VerifyClientCertIfGiven || tlsConfig.ClientAuth == tls.RequireAndVerifyClientCert {
pool, err := ca.LoadCertificates(cfg.ClientAuthCert, C.Path)
if err != nil {
log.Errorln("External controller tls listen error: %s", err)
@@ -233,7 +233,7 @@ func startTLS(cfg *Config) {
Handler: router(cfg.IsDebug, cfg.Secret, cfg.DohServer, cfg.Cors),
}
tlsServer = server
if err = server.Serve(tlsC.NewListenerForHttps(l, server, tlsConfig)); err != nil {
if err = server.Serve(tls.NewListener(l, tlsConfig)); err != nil {
log.Errorln("External controller tls serve error: %s", err)
}
}

View File

@@ -2,14 +2,14 @@ package route
import (
"fmt"
"net/http"
"os"
"github.com/metacubex/mihomo/component/updater"
"github.com/metacubex/mihomo/log"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/metacubex/chi"
"github.com/metacubex/chi/render"
"github.com/metacubex/http"
)
func upgradeRouter() http.Handler {