Skip to content

Commit 0d92468

Browse files
committed
fix(singbox): properly handle brutal config enable field in multiplex settings
1 parent 449664d commit 0d92468

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/subscription/singbox.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,17 @@ def _build_outbound(
322322
if inbound.mux_settings and (singbox_mux := inbound.mux_settings.get("sing_box")) and singbox_mux.get("enable"):
323323
# Filter out the enable field as it's not part of singbox multiplex config
324324
multiplex_config = {k: v for k, v in singbox_mux.items() if k != "enable"}
325+
326+
# Handle brutal configuration - only include if brutal.enable is True
327+
if "brutal" in multiplex_config:
328+
brutal_config = multiplex_config["brutal"]
329+
if brutal_config and brutal_config.get("enable"):
330+
# Filter out the enable field from brutal config
331+
multiplex_config["brutal"] = {k: v for k, v in brutal_config.items() if k != "enable"}
332+
else:
333+
# Remove brutal config entirely if enable is False or brutal is None
334+
multiplex_config.pop("brutal", None)
335+
325336
multiplex_config = self._normalize_and_remove_none_values(multiplex_config)
326337
config["multiplex"] = multiplex_config
327338

0 commit comments

Comments
 (0)