mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-27 23:13:43 +00:00
The producer (producers/surgemac.js) already supports a merge mode that emits N SOCKS5 listeners + one shared mihomo external process, avoiding the "one mihomo process per node" pattern. However the only way to enable it today is to write a per-proxy script operator that sets `_merge = true`. For users on networks where many subscription nodes are unreachable (e.g. CERNET / 校园网 to overseas VPS), the current default spawns dozens of idle-but-stuck mihomo subprocesses, each accumulating ~8s GFW-timeout outbound attempts that can cause system-wide slowdown. This patch wires two new URL query parameters into `produceOpts`: - `mihomoMerge=true|1` — enables the existing merge mode - `mihomoMergeName=<name>` — optional name for the merged entry Both only take effect when `target=SurgeMac` (i.e. when `useMihomoExternal` is already on). No behavior change for existing requests; default is unchanged.