From 53cff332b9e399f1dcb6ff3bfc611ebf9c32e2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larry=20Hao=EF=BC=88=E9=83=9D=E5=8D=93=E8=BF=9C=EF=BC=89?= <107194248+hhh2210@users.noreply.github.com> Date: Wed, 17 Jun 2026 22:23:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E8=A7=84=E8=8C=83=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E5=89=A5=E7=A6=BB=20subconverter=20=E6=B3=A8=E5=85=A5?= =?UTF-8?q?=E7=9A=84=20port/socks-port/redir-port=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E4=BF=9D=E7=95=99=20mixed-port=20(#276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(config): drop subconverter-injected port/socks-port/redir-port so only mixed-port is kept The bundled subconverter base templates hard-code a static listener block (port/socks-port/redir-port, with socks-port=7891). normalize_runtime_config only rewrites mixed-port and leaves that block in the generated config, while resolve_runtime_ports does not know those ports exist. On a busy shared host where 7890 is already taken, the auto-resolver shifts mixed-port to 7891 and it collides with the injected socks-port=7891. mihomo then binds socks on 7891 and silently fails to bind the mixed (http) listener, so the port clashctl exports as http_proxy has no HTTP handler and every request dies with "curl: (56) Proxy CONNECT aborted". Strip the legacy listener keys during normalization so the framework's single auto-managed mixed-port is the only proxy listener, which is what the default template already intends. * refactor(config): consolidate legacy port deletion into a single del() call Addresses Copilot review feedback on #276. Verified the bundled yq v4.52.4 supports deleting multiple paths in one del() expression. --- scripts/core/config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/core/config.sh b/scripts/core/config.sh index 86be060..834cfc7 100644 --- a/scripts/core/config.sh +++ b/scripts/core/config.sh @@ -839,6 +839,7 @@ normalize_runtime_config() { dns_listen_value="0.0.0.0:${dns_port_value}" \ "$(yq_bin)" eval -i ' .["mixed-port"] = (env(mixed_port) | tonumber) | + del(.port, .["socks-port"], .["redir-port"], .["tproxy-port"]) | .["external-controller"] = env(controller) | .secret = env(controller_secret_value) | .["external-ui"] = env(dashboard_dir_value) |