windows: autoProxy keeps to its exclusions, and its listing to its scope

proxy.autoProxy.exclude is never probed or routed: learn and probe
requests for an excluded host are refused, and a site learned whole
(example.com) routes no excluded name under it (intranet.example.com):
the learned rule skips them.

Without the secrets scope, proxy-ctl proxy auto lists the sites routed
and counts: the hosts probed, those left to zapret and the sites behind
each strike are browsing history, as the logs are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-27 16:36:00 +03:00
1 parent 5a89b8d11d
commit 694e176353
5 files changed
+82 -12

No files matched your search

+22
View File
@@ -267,3 +267,25 @@ fn auto_proxy_adds_probe_listeners_and_learned_rules() {
let sb = render_with(&state).sing_box.unwrap();
assert!(!sb["route"]["rules"].as_array().unwrap().iter().any(|r| r["rule_set"] == json!(["autoproxy-1"]) && r.get("outbound").is_some()));
}
#[test]
fn auto_proxy_never_routes_what_it_excludes() {
let dir = scratch("autoproxy-exclude");
let mut cfg = base();
cfg.proxy.auto_proxy.enable = true;
cfg.proxy.auto_proxy.max_exits = 2;
cfg.proxy.auto_proxy.exclude = vec!["intranet.example.com".into()];
let rules_dir = dir.join("rules");
std::fs::create_dir_all(&rules_dir).unwrap();
std::fs::write(rules_dir.join("rs-1.json"), r#"{"version":1,"rules":[{"domain_suffix":["example.com"]}]}"#).unwrap();
let mut e = env(&dir);
e.autoproxy_rules_dir = Some(rules_dir.to_string_lossy().into());
e.windows = false;
let r = render(&Input { cfg: &cfg, state: &State::default(), subscriptions: &BTreeMap::new(), env: &e, read_file: &no_files, tun: false }).unwrap();
let sb = r.sing_box.unwrap();
assert_eq!(
sb["route"]["rules"].as_array().unwrap().last().unwrap(),
&json!({ "type": "logical", "mode": "and", "rules": [{ "rule_set": ["autoproxy-1"] }, { "domain_suffix": ["intranet.example.com"], "invert": true }], "outbound": "nl" })
);
check_sing_box(&sb, &dir);
}