Files
clash-for-linux/scripts
Larry Hao(郝卓远) 53cff332b9 fix(config): 规范化时剥离 subconverter 注入的 port/socks-port/redir-port,只保留 mixed-port (#276)
* 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.
2026-06-17 22:23:41 +08:00
..