Skip to content

Commit 9fb5502

Browse files
committed
fix(subscription): add enabled field to brutal configuration for Clash and SingBox
1 parent b045399 commit 9fb5502

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/subscription/clash.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def _apply_mux(self, node: dict, mux_settings: dict | None):
211211
"only-tcp": clash_mux.get("only_tcp"),
212212
"padding": clash_mux.get("padding"),
213213
"brutal-opts": {
214+
"enabled": True,
214215
"up": clash_mux["brutal"]["up_mbps"],
215216
"down": clash_mux["brutal"]["down_mbps"],
216217
}

app/subscription/singbox.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,11 @@ def _build_outbound(
332332
if "brutal" in multiplex_config:
333333
brutal_config = multiplex_config["brutal"]
334334
if brutal_config and brutal_config.get("enable"):
335-
# Filter out the enable field from brutal config
336-
multiplex_config["brutal"] = {k: v for k, v in brutal_config.items() if k != "enable"}
335+
# Add enabled: true to brutal config
336+
multiplex_config["brutal"] = {
337+
"enabled": True,
338+
**{k: v for k, v in brutal_config.items() if k != "enable"}
339+
}
337340
else:
338341
# Remove brutal config entirely if enable is False or brutal is None
339342
multiplex_config.pop("brutal", None)

0 commit comments

Comments
 (0)