windows: zapret2 with z2k's strategies and upstream's Lua layers
The zapret2-extras component (tools/build-zapret2-extras.sh): z2k at upstream's pinned commit, its strategies made by its own generator as upstream's z2k-profiles.template.sh runs it, with tokens where upstream fills in the configuration at build time; its Lua, lists and fakes; and upstream's own Lua: the extended detector (detect.lua), the per-site key by public suffix, the fail stamp, every-change persistence and the strategy log. winws2 now runs, as upstream's nfqws2 does, with z2k's Lua for its strategies, then the layers: each site's working strategy kept across restarts (z2k's state layer), strategies keyed by site, and with autoHostlist.extendedDetection the detector learning in place of nfqws2's own (its last TLS profile, the stall watch where the learned sites are). Lua arguments name paths as Cygwin does (no colon); what winws2 writes stays under the Low-integrity folder. The server's TLS handshake and alert records reach the detectors through a WinDivert filter part: WinDivert has no per-flow packet window to hand them over by. Options go to winws2 in a file (@file): z2k's alone are 55 KB, past a Windows command line. Both sources, with every layer, verified by winws2's --dry-run under Wine (tools/winws-dry-run.sh). The DPI page picks the strategies and switches the detection. proxyFallback and the cutoff probe are said to be not on Windows yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0a7d8d99c0
commit
9eed225ccc
10 files changed
+471
-40
No files matched your search
@@ -15,6 +15,7 @@ use super::widgets::{card, hint, page, state_tag};
|
||||
use crate::model::Model;
|
||||
|
||||
const ENGINES: [(&str, &str); 2] = [("zapret-discord-youtube", "Flowseal's presets (zapret)"), ("zapret2", "zapret2")];
|
||||
const SOURCES: [(&str, &str); 2] = [("nfqws2-keenetic", "nfqws2-keenetic"), ("z2k", "z2k (per category: YouTube, Discord, QUIC, the RKN list)")];
|
||||
const GAME_FILTERS: [(&str, &str); 4] = [("null", "Off"), ("all", "TCP and UDP"), ("tcp", "TCP only"), ("udp", "UDP only")];
|
||||
|
||||
/// Preset names as the service matches them: without spaces, any case.
|
||||
@@ -180,7 +181,7 @@ impl Render for DpiPage {
|
||||
.child(engines)
|
||||
.child(hint(
|
||||
if engine == "zapret2" {
|
||||
"zapret2 (winws2) with nfqws2-keenetic's strategies; it learns which sites are blocked as it goes."
|
||||
"zapret2 (winws2): it learns which sites are blocked as it goes, rotates each one's strategy until one works, and keeps it across restarts."
|
||||
} else {
|
||||
"Flowseal's zapret-discord-youtube: winws with one of its presets, for YouTube, Discord and the sites in its lists."
|
||||
},
|
||||
@@ -189,9 +190,35 @@ impl Render for DpiPage {
|
||||
);
|
||||
|
||||
if engine == "zapret2" {
|
||||
let model = self.model.clone();
|
||||
let source = config["zapret"]["zapret2"]["strategySource"].as_str().unwrap_or("nfqws2-keenetic");
|
||||
let sources = RadioGroup::horizontal("strategy-source")
|
||||
.children(SOURCES.map(|(_, label)| label))
|
||||
.selected_index(SOURCES.iter().position(|(v, _)| *v == source))
|
||||
.on_change(move |ix, _, cx| {
|
||||
let (value, label) = SOURCES[*ix];
|
||||
model.update(cx, |m, cx| {
|
||||
m.edit(
|
||||
format!("Strategies: {label}"),
|
||||
move |c| {
|
||||
edits::set_path(c, &["zapret", "zapret2", "strategySource"], value.into());
|
||||
Ok(())
|
||||
},
|
||||
cx,
|
||||
)
|
||||
})
|
||||
});
|
||||
body = body.child(
|
||||
card("zapret2", None, cx)
|
||||
.child(div().text_sm().child("Strategies"))
|
||||
.child(sources)
|
||||
.child(self.option_switch("autohostlist", "Learn which sites are blocked", &["zapret", "zapret2", "autoHostlist", "enable"], &config))
|
||||
.child(self.option_switch(
|
||||
"extended-detection",
|
||||
"Extended detection: also sites blocked only some of the time, and requests that never get an answer",
|
||||
&["zapret", "zapret2", "autoHostlist", "extendedDetection"],
|
||||
&config,
|
||||
))
|
||||
.child(self.option_switch("ipv6", "IPv6 too", &["zapret", "zapret2", "ipv6"], &config))
|
||||
.child(self.option_switch("strategy-log", "Log the strategy each site gets", &["zapret", "zapret2", "strategyLog"], &config)),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user