windows: the kill switch

Upstream's killSwitch, on the Windows Filtering Platform: while the TUN or a
system-wide AmneziaWG profile is on, connections that would leave past it are
blocked at the ALE connect layers, while the tunnel runs, restarts or has
failed. Open: loopback, the private and reserved networks with
allowedSubnets, what leaves from the tunnels' own addresses, the tunnel's own
programs (the backend, its helpers, awg-tunnel; the service with
directFallbacks), NTP with allowTimeSync. Turning a tunnel off, or
proxy-ctl killswitch off / the Overview's Lift, lifts it until a tunnel is
turned on again.

The filters live in a dynamic WFP session of the service's: they go with
it, so stopping the service always gets the network back. Upstream holds
from boot; that needs persistent filters, for once these are seen to work
on real Windows (Wine has no WFP). A changed plan goes in under the other of
two sublayers before the old one goes, so nothing leaks between.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Opus 5.5 committed 2026-10-28 00:17:24 +03:00
1 parent ddc1bbe686
commit 32ff264c81
12 files changed
+557 -9

No files matched your search

+1
View File
@@ -14,4 +14,5 @@ Each has its SHA-256 in the `.sha256` file next to it. SmartScreen may warn of a
- **The app in Russian**: every page, the tray's menu and the notifications, as Windows' display language is (or chosen in Settings → This app). What the service itself says (its warnings and errors) and `proxy-ctl` stay English.
- **The XRay-only backend** (`proxy.backend = "xray"`): the local proxy runs on XRay alone, with upstream's config: a SOCKS listener (with a login when set), DNS ordered by the routing mode with the proxy servers' names kept off the proxy, the route modes' lists, `urltest` as a `leastPing` balancer with an observatory (a pin or `first` leaves the one exit), chains, and the helpers (Tor, SSH, WARP, AmneziaWG, whitelist-bypass) as SOCKS hops. What needs sing-box is refused as upstream refuses it (groups, rule sets, autoProxy, latency tests, `selector`/`failover`, DoT, fake IP, the connection log), and so are the TUN and per-app routing, which XRay has no Windows counterpart for yet. The service checks the config with `xray run -test` before it replaces the running one.
- **The TUN and the DPI bypass together**: zapret and zapret2 leave the TUN's own packets alone (by its address, in WinDivert's filter) and handle what sing-box sends out of the real adapter, as upstream keeps zapret off the TUN interface.
- **The kill switch** (`killSwitch`, off by default): while the global tunnel (the TUN, or a system-wide AmneziaWG profile) is on, what would leave past it is blocked, while it runs, restarts or has failed; LAN, DHCP and NTP stay open, and the tunnel's own programs. Windows Filtering Platform filters do it, in the service's own session: they go with the service (upstream's holds from boot; that comes once these have been seen to work on real Windows). Turning the tunnel off, `proxy-ctl killswitch off` or the Overview's **Lift** lets go until a tunnel is turned on again. Not yet tried on real Windows: please do, and `sc stop ProxySuite` gets the network back if it misbehaves.
- **A dark theme**: light, dark, or as Windows is set (the default), in Settings → This app or at the sun/moon in the sidebar; the window's title bar follows it.