From 765cbbcc014fb38be9e5891eedd85c34f7a9f431 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Wed, 25 Jun 2025 21:19:36 +0800 Subject: [PATCH] fix: miss config in patch --- hub/route/configs.go | 50 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/hub/route/configs.go b/hub/route/configs.go index 2ccd5af1..1ce05a14 100644 --- a/hub/route/configs.go +++ b/hub/route/configs.go @@ -7,6 +7,7 @@ import ( "github.com/metacubex/mihomo/adapter/inbound" "github.com/metacubex/mihomo/component/dialer" + "github.com/metacubex/mihomo/component/process" "github.com/metacubex/mihomo/component/resolver" "github.com/metacubex/mihomo/component/updater" "github.com/metacubex/mihomo/config" @@ -33,28 +34,29 @@ func configRouter() http.Handler { } type configSchema struct { - Port *int `json:"port"` - SocksPort *int `json:"socks-port"` - RedirPort *int `json:"redir-port"` - TProxyPort *int `json:"tproxy-port"` - MixedPort *int `json:"mixed-port"` - Tun *tunSchema `json:"tun"` - TuicServer *tuicServerSchema `json:"tuic-server"` - ShadowSocksConfig *string `json:"ss-config"` - VmessConfig *string `json:"vmess-config"` - TcptunConfig *string `json:"tcptun-config"` - UdptunConfig *string `json:"udptun-config"` - AllowLan *bool `json:"allow-lan"` - SkipAuthPrefixes *[]netip.Prefix `json:"skip-auth-prefixes"` - LanAllowedIPs *[]netip.Prefix `json:"lan-allowed-ips"` - LanDisAllowedIPs *[]netip.Prefix `json:"lan-disallowed-ips"` - BindAddress *string `json:"bind-address"` - Mode *tunnel.TunnelMode `json:"mode"` - LogLevel *log.LogLevel `json:"log-level"` - IPv6 *bool `json:"ipv6"` - Sniffing *bool `json:"sniffing"` - TcpConcurrent *bool `json:"tcp-concurrent"` - InterfaceName *string `json:"interface-name"` + Port *int `json:"port"` + SocksPort *int `json:"socks-port"` + RedirPort *int `json:"redir-port"` + TProxyPort *int `json:"tproxy-port"` + MixedPort *int `json:"mixed-port"` + Tun *tunSchema `json:"tun"` + TuicServer *tuicServerSchema `json:"tuic-server"` + ShadowSocksConfig *string `json:"ss-config"` + VmessConfig *string `json:"vmess-config"` + TcptunConfig *string `json:"tcptun-config"` + UdptunConfig *string `json:"udptun-config"` + AllowLan *bool `json:"allow-lan"` + SkipAuthPrefixes *[]netip.Prefix `json:"skip-auth-prefixes"` + LanAllowedIPs *[]netip.Prefix `json:"lan-allowed-ips"` + LanDisAllowedIPs *[]netip.Prefix `json:"lan-disallowed-ips"` + BindAddress *string `json:"bind-address"` + Mode *tunnel.TunnelMode `json:"mode"` + LogLevel *log.LogLevel `json:"log-level"` + IPv6 *bool `json:"ipv6"` + Sniffing *bool `json:"sniffing"` + TcpConcurrent *bool `json:"tcp-concurrent"` + FindProcessMode *process.FindProcessMode `json:"find-process-mode"` + InterfaceName *string `json:"interface-name"` } type tunSchema struct { @@ -341,6 +343,10 @@ func patchConfigs(w http.ResponseWriter, r *http.Request) { tunnel.SetMode(*general.Mode) } + if general.FindProcessMode != nil { + tunnel.SetFindProcessMode(*general.FindProcessMode) + } + if general.LogLevel != nil { log.SetLevel(*general.LogLevel) }