feat(route-rule): a proxy rule can pick its proxies by name (proxy_filter) #181
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.50) × (1 − Review Confidence (0.37)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 626 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 62% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.385
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #181"
general
weight: 0.35
claude[bot]
Problem
A route rule can send traffic to the proxy, direct, or block, but "the proxy" is always the main one: whatever is picked in
select. There is no way to say "these sites through a server in Germany, everything else as usual", which comes up for services that serve or price by country, or refuse some exits. Today the only way is to switch the main proxy by hand, or keep a second profile and switch profiles.Other clients do this with a group filtered by name (mihomo's
filteron a proxy group), and subscription names already carry the country, as a flag or a word ("🇩🇪 Germany [1]", "🇩🇪 Германия").Change
proxy_filterin the app'sRule(v2/config/route_rule.proto, field 19, regenerated with the same protoc-gen-go v1.34.2). It is an RE2 expression, case-insensitive, on the names of the profile's proxies. It is empty by default, so nothing changes for current rules.lowest-delay, with the same tolerance aslowest(proxyOutboundinv2/config/route_rules.go). Rules with the same filter share one balancer. The balancers arerule-proxies-N §hide§, a number past any tag the profile already has, so they don't show in the proxy list.lowestandbalance, and without the§ Nthat numbering adds or the§…§markers. So^🇩🇪 germany \[\d\]$works on a numbered subscription.ipv6_unavailable_viathe balancer), so IPv6 the filter's proxies can't carry falls back to IPv4 at once, as it does for the main proxy.pinned(ApplyKeepTop). Otherwise, at rest, none of them answers and the balancer stays on its first, untested member.HISTORY.md.Tested
go vetandgo test ./v2/config/with the core tags. The new tests inv2/config/route_rule_proxy_filter_test.gobuild throughBuildConfigandlibbox.CheckConfigOptions. They check:- matching: a flag filter picks two proxies of three; a word filter ignores case;
^germany$matches the numbered repeats and not "Germany West"; a profile of one proxy works;- balancers: two rules with one filter share a balancer, and another filter gets its own;
- fallbacks: no filter, no match, an invalid expression, only spaces and a missed anchor each go to
select, with no balancer;- other outbounds: direct, direct with fragment and block rules ignore the filter;
- tags: a profile proxy already tagged
rule-proxies-1 §hide§doesn't collide;- chains: extra security routes to the hop; with the unblocker, the members dial through the hop;
- IPv6: the reject comes first with IPv6 on, and isn't added with IPv6 off;
- keep top: it pins the filter's proxies;
- app JSON:
"proxy_filter": "🇩🇪"is read.With the matching, balancer, extra security, IPv6 and keep top parts of the change reverted, the tests that cover them fail.
HiddifyCli parse, thenbuildwith aclaude.airule, thensrunin proxy mode.- With the filter
🇩🇪, the balancer got the five German proxies. With^🇩🇪 germany \[\d\]$, it got the three numbered ones.-
claude.ai/cdn-cgi/traceansweredloc=DEevery time.cloudflare.com/cdn-cgi/tracewent through the main proxy (loc=RU).Unrelated, seen on
mainas it is now:dns_group_test.go,keep_top_test.goandinbound_ports_test.goinv2/configdon't compile. Their helperschainTestOptions,chainTestProfile,oneProxyProfileandselectorItemsare in a file that isn't committed.For the app
The rule editor needs a text field "Proxy filter" under the outbound when it is "proxy", with a hint such as "Only proxies whose name matches, e.g. 🇩🇪|germany", sent as
proxy_filter. I can open that PR in hiddify-app once this one is in.Review