fix: zapret2 improvements

This commit is contained in:
FUFSoB committed 2026-10-04 19:43:32 +05:00
1 parent 2452d6fbe1
commit 017a947a18
24 files changed
+1350 -99

No files matched your search

+2
View File
@@ -391,6 +391,7 @@ services.proxy-suite = {
autoHostlist = {
debugLog = false;
enable = true;
extendedDetection = true;
failThreshold = 3;
failTime = 300;
incomingMaxseq = 4096;
@@ -416,6 +417,7 @@ services.proxy-suite = {
udp = null;
};
profiles = null;
proxyFallback = true;
strategyLog = true;
strategySource = "nfqws2-keenetic";
};
+31 -3
View File
@@ -41,6 +41,7 @@ Part of the [proxy-suite options reference](./index.md).
- autoHostlist
- [enable](#services-proxy-suite-zapret-zapret2-autohostlist-enable)
- [debugLog](#services-proxy-suite-zapret-zapret2-autohostlist-debuglog)
- [extendedDetection](#services-proxy-suite-zapret-zapret2-autohostlist-extendeddetection)
- [failThreshold](#services-proxy-suite-zapret-zapret2-autohostlist-failthreshold)
- [failTime](#services-proxy-suite-zapret-zapret2-autohostlist-failtime)
- [incomingMaxseq](#services-proxy-suite-zapret-zapret2-autohostlist-incomingmaxseq)
@@ -63,6 +64,7 @@ Part of the [proxy-suite options reference](./index.md).
- [tcp](#services-proxy-suite-zapret-zapret2-ports-tcp)
- [udp](#services-proxy-suite-zapret-zapret2-ports-udp)
- [profiles](#services-proxy-suite-zapret-zapret2-profiles)
- [proxyFallback](#services-proxy-suite-zapret-zapret2-proxyfallback)
- [strategyLog](#services-proxy-suite-zapret-zapret2-strategylog)
- [strategySource](#services-proxy-suite-zapret-zapret2-strategysource)
@@ -95,8 +97,9 @@ Subnets zapret skips\.
## services\.proxy-suite\.zapret\.directSync\.enable
Send zapret’s domains direct in the proxy routing, so zapret handles them\. With zapret2,
also the sites it pins and learns at runtime, after your own rules and autoProxy’s\.
The all-proxy and all-bypass route modes leave them out, like every direct list\.
also the sites pinned at runtime, and the ones it learns once a strategy is seen getting
through for them, after your own rules and autoProxy’s\. The all-proxy and all-bypass
route modes leave them out, like every direct list\.
**Type:** boolean\
**Default:** `true`
@@ -322,11 +325,23 @@ blocked\. When off, only ` zapret2.domains ` and ` proxy-ctl zapret auto add ` a
<a id="services-proxy-suite-zapret-zapret2-autohostlist-debuglog"></a>
## services\.proxy-suite\.zapret\.zapret2\.autoHostlist\.debugLog
Log why sites are or are not learned\.
Log why sites are or are not learned (nfqws2’s own learner)\.
**Type:** boolean\
**Default:** `false`
<a id="services-proxy-suite-zapret-zapret2-autohostlist-extendeddetection"></a>
## services\.proxy-suite\.zapret\.zapret2\.autoHostlist\.extendedDetection
Learn with proxy-suite’s detector instead of nfqws2’s\. It also learns sites blocked
only some of the time (a working connection no longer clears the failures before it),
downloads that stall partway (the 16 KB cutoff), and requests that never get an
answer\. Learned sites are logged with ` strategyLog `\. Only with the source’s own
` profiles `, and for TLS: nfqws2-keenetic no longer learns plain HTTP sites\.
**Type:** boolean\
**Default:** `true`
<a id="services-proxy-suite-zapret-zapret2-autohostlist-failthreshold"></a>
## services\.proxy-suite\.zapret\.zapret2\.autoHostlist\.failThreshold
@@ -512,6 +527,19 @@ learning\. ` --qnum `, ` --fwmark ` and ` --lua-init ` are added for you\. ` nul
]
```
<a id="services-proxy-suite-zapret-zapret2-proxyfallback"></a>
## services\.proxy-suite\.zapret\.zapret2\.proxyFallback
Send through the proxy what zapret2 cannot fix: a site none of its strategies get
through for (only its QUIC, when that alone fails), and an address that leaves
connections unanswered (blocked by address, as Telegram’s are)\. Learned sites go
direct (` zapret.directSync `) only once a strategy is seen working for them\. Needs an
outbound; works for traffic the proxy sees (TUN, TProxy, per-app routing; by address
only where it sees the address)\. ` proxy-ctl zapret auto retry ` gives one another try\.
**Type:** boolean\
**Default:** `true`
<a id="services-proxy-suite-zapret-zapret2-strategylog"></a>
## services\.proxy-suite\.zapret\.zapret2\.strategyLog
+12 -5
View File
@@ -28,7 +28,13 @@ as `"general (ALT9)"`.
## Blocked sites found automatically: zapret2
zapret2 notices failing connections, marks the site as blocked, and finds a strategy that
works for it. Each site's strategy is remembered.
works for it. Each site's strategy is remembered. It also learns sites blocked only some of
the time, downloads that stall partway, and requests that never get an answer.
What zapret2 cannot fix goes through your proxy, when you have one: a site none of its
strategies get through for (only its QUIC, when that alone fails), and an address that
never answers at all, as Telegram's are blocked. That works for traffic the proxy sees
(TUN, TProxy, per-app routing).
```nix
services.proxy-suite = {
@@ -61,8 +67,9 @@ services.proxy-suite.zapret.zapret2.ports.extraUdp = [ "27015-27030" ];
```sh
proxy-ctl zapret # status
proxy-ctl zapret off # or: on, toggle, restart
proxy-ctl zapret auto # sites zapret2 learned
proxy-ctl zapret auto # sites zapret2 learned, and what goes to the proxy
proxy-ctl zapret auto add example.com # treat a site as blocked
proxy-ctl zapret auto retry example.com # give zapret2 another try at what it sent the proxy
proxy-ctl zapret auto exclude example.com # never touch or learn a site
proxy-ctl zapret auto forget example.com # forget it and its strategy
proxy-ctl zapret cutoff # networks cut off at 16 KB (z2k)
@@ -72,9 +79,9 @@ proxy-ctl zapret cutoff # networks cut off at 16 KB (z2k)
zapret and the proxy work side by side. By default (`zapret.directSync`), the sites zapret
handles are sent direct, so they skip the proxy and reach zapret. With zapret2 that includes
the sites it learns and the ones you pin with `proxy-ctl zapret auto add`, as soon as they
are added; your own rules and autoProxy still come first. Everything else follows your
[routing rules](./routing.md).
the ones you pin with `proxy-ctl zapret auto add`, and the sites it learns once one of its
strategies is seen getting through; your own rules and autoProxy still come first.
Everything else follows your [routing rules](./routing.md).
## Only for some apps