# Proxy Suite for Windows A native Windows port of [proxy-suite-flake](https://github.com/FUFSoB/proxy-suite-flake): the same configuration (upstream's `services.proxy-suite` options, same names and defaults), run by a Windows service instead of NixOS and systemd, controlled from its desktop app (window and tray icon) or with `proxy-ctl`, as upstream's is. > [!WARNING] > **Pre-release.** Built and tested on Linux and under Wine, **never yet run on real Windows.** > Read [what has been verified](#what-has-been-verified) before relying on it, and please > report what happens on yours. > [!IMPORTANT] > For study and research only, as upstream: learning how proxies, tunnels and traffic > routing work. No warranty. ## What it does (this release) | | | |---|---| | Local proxy | SOCKS5/HTTP on `127.0.0.1:1080` through sing-box (or the hybrid sing-box + XRay backend) | | Outbounds | links (vless/REALITY/TLS, vmess, trojan, shadowsocks, hysteria2, tuic, anytls, naive, socks, http), raw JSON, subscriptions, groups (failover, urltest, selector), chains, pins, route modes, routing rules by site, address, geodata, rule set or **program** | | zapret | Flowseal's [zapret-discord-youtube](https://github.com/Flowseal/zapret-discord-youtube) release: `winws.exe` with any of its `general*.bat` presets, your lists, the game filter, and `hostlistRules` (a strategy of its own for a group of sites, copied from a preset or given) | | zapret2 | `winws2.exe` from bol-van's [zapret-win-bundle](https://github.com/bol-van/zapret-win-bundle) with [nfqws2-keenetic](https://github.com/nfqws/nfqws2-keenetic)'s strategies or [z2k](https://github.com/necronicle/z2k)'s (made by z2k's own generator, per category: YouTube, Discord, QUIC, the RKN list), and upstream's Lua around them: each site's working strategy kept across restarts, strategies keyed by site (the public suffix list), and the extended detector, which also learns sites blocked only some of the time and requests that never get an answer. The server's TLS replies reach the detectors through a WinDivert filter part; a download stalling mid-way (the 16 KB cutoff) is not seen on Windows, as WinDivert cannot hand over a flow's first packets alone. By its detector's verdicts the proxy routes too: what zapret2 cannot fix goes through the proxy (`proxyFallback`), what it fixes goes direct so it sees it (`directSync`) | | tg-ws-proxy | Flowseal's [tg-ws-proxy](https://github.com/Flowseal/tg-ws-proxy), the headless proxy, on a bundled Python | | Tor | `tor`: the Tor Project's own Windows build (the Expert Bundle, signed, pinned), with bridges (obfs4, webtunnel, snowflake, meek, conjure) and, with `asOutbound`, an outbound of the proxy | | AmneziaWG | `amneziaWg` profiles, from a `.conf`, an AmneziaVPN `vpn://` link or settings. Without `asOutbound`, a **system-wide VPN**: amneziawg-windows's tunnel (amneziawg-go on Wintun, built from its source) as a Windows service of its own, with its routes, DNS and, for one peer that takes everything, its firewall blocking what leaves outside the tunnel; on and off in the app or `proxy-ctl awg on|off`. As outbounds: `"userspace"` (wireproxy-awg, built from upstream's source, AmneziaWG's obfuscation kept, no driver) or `"singBox"` (plain WireGuard). WARP devices take either kind too | | WARP | `warp` with `asOutbound = "singBox"` or `"userspace"`: each device registered with Cloudflare as wgcf registers (through the local proxy first, then directly, then `generatorUrl`), or a profile given; a sing-box WireGuard endpoint, several grouped as `warp` | | autoProxy | `proxy.autoProxy`: the sites apps reach directly are probed through each exit in turn (direct first); one blocked directly but reached through an exit is routed through it, as upstream's prober decides (block pages, one exit per network first, strikes against exits that refuse). Blocks zapret can fix stay direct. A site that crawls directly (`slowBelowKiBps`) moves to the first exit that carries it as well as direct does. Its page in the app, or `proxy-ctl proxy auto`, shows, probes, learns and forgets | | whitelist-bypass | `whitelistBypass`: [whitelist-bypass](https://github.com/kulikov0/whitelist-bypass)'s headless creators and joiners (WB Stream, Telemost, DION, Bitrix; VK creators), built from upstream's source: a joiner is an outbound of the proxy tunnelled through a video call, a creator the call's free end. `proxy-ctl wl` gives the links and logins | | SSH tunnel | `sshProxy`: Windows' own OpenSSH as a SOCKS listener (`ssh -D`) for other programs, and, with `asOutbound`, an outbound of the proxy (sing-box's SSH client) | | TUN | sing-box's TUN (wintun), `proxy-ctl proxy tun on` — **see the caveats** | | The app | **Proxy Suite** in the Start Menu, and a tray icon from sign-in: the proxy, DPI bypass and Telegram proxy at a glance and a click; outbounds, subscriptions and the routing mode; zapret's presets and sites; tg-ws-proxy's links; whitelist-bypass's joiners and creators (links, logins); autoProxy's routes, probes and exits; the logs; **every option** in its JSON editor, checked by the service before it takes it; the system proxy | Not in this release, still to come: Tor's onion service, the kill switch, server inbounds, the XRay-only backend and zapret2's 16 KB cutoff probe. Their options are accepted (they are upstream's), but the service says, in its status and in the app, that it does not run them yet. Needs 64-bit Windows 10 (1903 or later) or 11. ## Screenshots Taken on Linux against the service with a demo configuration (`tools/screenshots.sh`), so the DPI bypass, which runs on Windows only, shows as inactive. | | | |---|---| | ![Overview](docs/screenshots/overview.png) | ![DPI bypass](docs/screenshots/dpi-bypass.png) | | ![Outbounds](docs/screenshots/outbounds.png) | ![autoProxy](docs/screenshots/autoproxy.png) | | ![AmneziaWG](docs/screenshots/amneziawg.png) | ![Whitelist bypass](docs/screenshots/whitelist-bypass.png) | | ![Telegram proxy](docs/screenshots/telegram.png) | ![Settings](docs/screenshots/settings.png) | ## What has been verified | Part | How | |---|---| | Share-link and subscription parsing | upstream's tests, ported; ~750 links through upstream's Python and this, identical results | | sing-box and XRay configs | rendered for many setups and accepted by `sing-box check` and `xray run -test` | | Service, API, `proxy-ctl` | end to end on Linux: a real sing-box Shadowsocks server, the service, `proxy-ctl` adding the outbound, a page fetched through the local proxy | | Windows build: service, named pipe, its ACL, caller identification, component hashes, supervisor | under Wine (`tools/wine-e2e.sh`) | | zapret arguments | **every** preset of the release, both game filters, checked by the release's own `winws.exe --dry-run` under Wine (`tools/winws-dry-run.sh`) | | zapret2 arguments | checked by `winws2.exe --dry-run` under Wine | | tg-ws-proxy | runs and listens under Wine | | SSH tunnel | end to end on Linux: an sshd of the test's own, a page through the `ssh -D` listener and through sing-box's SSH outbound, each logging in with the service's copy of the key (`an_ssh_tunnel`) | | Tor | its Windows `tor.exe` (under Wine) accepts the torrc the service writes, bridges and transports included; on Linux the service runs Tor with it and Tor starts bootstrapping (where Tor's relays are blocked, it needs bridges) | | AmneziaWG | profiles from `.conf`, `vpn://` links and settings converted exactly as upstream's script converts them (its own encoder's links as test vectors); end to end on Linux: sing-box as a WireGuard server, the service running wireproxy-awg, a page through its listener and through the proxy's outbound (`an_amneziawg_tunnel`) | | autoProxy | its judgement (upstream's verdicts, walk, exit order, strikes, state) by unit tests; the config with its probe listeners and learned rule-sets accepted by `sing-box check`; on Linux with a local exit: probes through direct and the exit, a learn request, a site an app reached directly queued from the Clash API and probed at the next run, the state and the rule-set files written; a download held to 40 KiB/s seen crawling and moved to the exit. A site blocked here and reached through an exit needs a remote exit, so none was routed that way | | whitelist-bypass | its Windows programs built from upstream's tag with upstream's patches (links and passwords from the environment, never the command line); on Linux the service runs a joiner and a creator with their flags, the link and the login reaching them (`proxy-ctl wl join`, `wl auth`, `wl new`, `wl link`); a real call needs an account on a platform, so none was made | | AmneziaWG system-wide | under Wine's service manager (`tools/wine-setup-test.sh`): a profile added registers its tunnel service (program, configuration, dependencies), `proxy-ctl awg on` starts it, and the tunnel runs as a service up to creating the Wintun adapter, which Wine cannot; its log is read back; the service goes with its profile. Traffic through it needs real Windows | | WARP | a device registered live with Cloudflare by the service, its profile rendered as a sing-box endpoint and accepted; traffic through it not (this test machine blocks outgoing UDP) | | zapret's hostlist rules | every preset with sample rules, checked by `winws.exe --dry-run` (a preset without the profile a rule copies is refused, as upstream refuses it) | | The app | every page against the service running on Linux, in a window on a virtual display (Xvfb, Mesa's software Vulkan), clicked and typed into by a script, screenshots looked at, and the service's configuration checked after each change (`tools/gui-shot.sh`) | | The setup program | under Wine (`tools/wine-setup-test.sh`): a silent install puts every file of the release into Program Files and the entry into Settings → Apps, the service runs and answers; the same setup again over the running install upgrades it; the entry's uninstall removes the service, the files and the entry. Its pages (and the Russian ones) not looked at | | The app's Windows build | built by the release workflow; its shaders by Microsoft's own `fxc.exe` (under Wine) with GPUI's own arguments; its icon and manifest in its resources, no C runtime DLL among its imports; under Wine it starts and gets as far as drawing text | **Not verified: anything that needs real Windows.** Traffic through sing-box on Windows (Wine lacks an API it needs), the TUN adapter, WinDivert actually rewriting packets, the Windows service under the Service Control Manager, `install`/`uninstall`, the system PATH change, and **the app drawing on Windows** (Wine's DirectWrite cannot match fonts, so no text is drawn there), its tray icon, the system proxy and the Start Menu entry. ## Install 1. Download `ProxySuite--windows-x64-setup.exe` and run it. It asks for administrator rights; SmartScreen may warn of an unknown publisher (the programs are not signed yet): **More info** → **Run anyway**. 2. It installs everything into `C:\Program Files\ProxySuite`, registers the **ProxySuite** service (starts at boot), adds `proxy-ctl` to PATH, starts it, and opens the app; the app starts at every sign-in, in the tray (its shield is green while things work, amber when one failed, grey when all is off). One option, unchecked: Windows' **OpenSSH Client**, for the SSH tunnel only, where it was removed from Windows (Windows 10 1809 and later have it). 3. Open **Proxy Suite** from the Start Menu or the tray, or in a **new** terminal: `proxy-ctl status`. Nothing has to be installed first: the C runtime is linked into the programs, and WinDivert, wintun, Python, Tor and the rest come with it, as components. For a silent install: `ProxySuite--windows-x64-setup.exe /S`. To upgrade, run the new setup: the settings stay. To remove: **Settings → Apps → Proxy Suite → Uninstall** (it runs `uninstall.cmd` in that folder); the configuration and state stay in `%ProgramData%\ProxySuite` until you delete it. Without the setup program: unzip `ProxySuite--windows-x64.zip` anywhere and run `install.cmd` (it asks for administrator rights): the same install, from the same files. Windows Defender and other antivirus software may flag WinDivert (zapret's driver): it is a packet-filtering driver, which is what it is for. Remove other DPI-bypass tools first: Flowseal's own `zapret` service (its `service.bat` → Remove Services) or GoodbyeDPI — the service refuses to start zapret while one runs, and says which. ## First run In the app: **Outbounds** → paste a link → **Add**, then switch the local proxy on in the **Overview** (and, if wanted, *Use it as the system proxy*). **DPI bypass** switches zapret on and picks its preset; **Telegram proxy** gives the link to open in Telegram. Or from a terminal: ```powershell # A proxy: proxy-ctl proxy outbounds add "vless://...#My Server" proxy-ctl proxy on proxy-ctl status # Then point apps (or Windows: Settings → Network → Proxy) at 127.0.0.1:1080. # Or a subscription: proxy-ctl proxy subs add https://provider.example/sub/token # zapret, Flowseal's presets: proxy-ctl zapret on proxy-ctl zapret preset "general (ALT9)" proxy-ctl zapret game-filter all # zapret2 instead: proxy-ctl config get > config.json # set "zapret": { "enable": true, "engine": "zapret2" } proxy-ctl config set config.json # Telegram's WebSocket proxy: proxy-ctl config get > config.json # set "tgWsProxy": { "enable": true } proxy-ctl config set config.json proxy-ctl logs proxy-suite-tg-ws-proxy # its tg:// link and secret # whitelist-bypass: a joiner here (set "whitelistBypass": { "enable": true, # "joiners": { "wl": { "platform": "wbstream" } } }), its creator's link from the other end: proxy-ctl wl join wl "https://..." proxy-ctl proxy pin wl # A creator: its login (a cookies export; DION and Bitrix ask for an email and password), its call: proxy-ctl wl auth laptop cookies.json proxy-ctl wl link laptop # AmneziaWG as a system-wide VPN (a profile without asOutbound): proxy-ctl awg # profiles and their state proxy-ctl awg on home # start it; off stops it proxy-ctl awg log home # its tunnel's log # autoProxy (set "proxy": { "autoProxy": { "enable": true } }): proxy-ctl proxy auto # what it routed, and where proxy-ctl proxy auto probe example.com # how a site answers through each exit proxy-ctl proxy auto learn example.com # probe it now, route it if it needs it proxy-ctl logs -f # everything, following proxy-ctl --help ``` ## The configuration The app's **Settings** page edits it whole, and checks it with the service before saving. `proxy-ctl config get` prints it, `proxy-ctl config set ` replaces it (checked first; a bad one changes nothing), `proxy-ctl config validate ` only checks. It is upstream's option tree as JSON, so [upstream's option reference](../docs/options/index.md) describes it: `services.proxy-suite.proxy.listener.port` is `{"proxy": {"listener": {"port": …}}}`. Options that only mean something on Linux (TProxy, fwmarks, routing tables, packages) are not there; the Windows-only ones are documented in `crates/ps-core/src/config/`: - `proxy.singBox.testPort`; `proxy.systemProxy` (applied by the app, for the signed-in user) - `proxy.routing.rules.*.processNames` / `processPaths` (and `name`, `priority`, `disabled`) - `perAppRouting.profiles.*`: programs held to an outbound, by name or path - `zapret.tcpTimestamps`, `geodata` as download locations, `tor.controlPort` - inline `config` text where upstream only takes a file (AmneziaWG, WARP) ## Who may change what The service runs as LocalSystem. Its settings are meant to be edited by whoever uses the machine, so — **unlike upstream, where changes need root** — `userControl` defaults to on for the signed-in user, with every scope. On a shared computer, set `userControl.scopes` (or turn `userControl.enable` off) as an administrator. Whatever the scopes, these always need an administrator: anything that makes the service run a program, pass arguments to one, or read or write a file of the caller's choosing — every `*File` option, raw `singBoxJson`/`xrayJson`, `sshProxy.extraArgs`, `tor.extraConfig`, `nfqwsArgs`, zapret2's `profiles` and `blobs`, `allowConfigHooks`, and `userControl` itself — and installing components. Secrets (links, passwords) are hidden from callers without the `secrets` scope, and survive a round trip through `config get`/`config set` unchanged. ## Caveats - **TUN and zapret together**: upstream keeps zapret's packets off the TUN interface, which this release does not do yet. Use one or the other. - zapret2 learns with nfqws2's own detector, not upstream's extended one; z2k's strategies are not there yet. - The global TUN restarts the local proxy when it is turned on or off (one sing-box does both). - The system proxy is set by the app, for the user it runs as, while it runs: quitting the app puts the user's own setting back. ## Components The release carries every program it runs, each pinned by version and hash ([`components.json`](components.json)), and the service checks each against the hashes recorded at install before running it. `proxy-ctl components` lists them; `proxy-ctl components install [name…]` fetches and verifies them again (administrator). See [`THIRD-PARTY.md`](THIRD-PARTY.md) for their licenses and sources. ## Building On Linux with Nix: `nix develop` here (this directory has its own `flake.nix`), then ```sh cargo test # everything but the app; sing-box and xray from the shell python3 -I tools/parity/links.py # link parsing against upstream's Python tools/package.sh # the setup program and the zip, in dist/ nix shell nixpkgs#wineWow64Packages.stable -c tools/winws-dry-run.sh dist/ProxySuite-*/components nix shell nixpkgs#wineWow64Packages.stable -c tools/wine-setup-test.sh dist/ProxySuite-*-setup.exe dist/ProxySuite-*-x64 ``` The app on Linux, against the service on Linux: ```sh tools/dev-service.sh # the service, a demo outbound; leave it running cargo run -p ps-gui -- --socket "$XDG_RUNTIME_DIR/proxy-suite-dev.sock" tools/gui-shot.sh shot.png 8 -- --socket "$XDG_RUNTIME_DIR/proxy-suite-dev.sock" # headless ``` Its Windows build compiles GPUI's shaders with Microsoft's `fxc.exe` under Wine (`tools/fxc-wine.sh`, fetched from the Windows SDK and pinned by hash; it stays on the build machine), through a small patch to GPUI's Windows backend (`vendor/gpui-pre-windows`). The Windows programs are cross-compiled with `cargo xwin` (MSVC target, the C runtime linked in: `.cargo/config.toml`), with the toolchain in `rust-toolchain.toml`. The setup program is NSIS's (`tools/installer.nsi`, `makensis` from the shell): it unpacks the release and runs its `proxy-suite-service.exe install`, as `install.cmd` does. Design notes: [`DESIGN.md`](DESIGN.md). Releases are built by Gitea Actions (`.gitea/workflows/windows-release.yml`): bump `version` in `Cargo.toml`, add `release-notes/.md`, push a tag `windows-v`. The workflow tests, packages and publishes the setup program and the zip, each with its `.sha256`, with the `RELEASE_TOKEN` secret (a token with `write:repository`). Run by hand, it only builds.