Files
proxy-suite-flake/windows/README.md
T
faumarayandClaude Opus 5.5 4ae30dac3c windows: ps-client shared by proxy-ctl and the app; the app's first window
- ps-client: the service's client side, moved out of proxy-ctl: calls,
  configuration edits against the revision read (retried on a concurrent
  change), log following, and the edits themselves as functions on the
  configuration (outbounds, subscriptions, rules, zapret, tg-ws-proxy),
  now unit-tested. proxy-ctl does what it did, through it; a refused log
  follow is now an error instead of nothing.
- ps-gui: proxy-suite, the desktop app on GPUI (gpui-kit 0.8.1); only a
  first window yet. Not in default-members: plain cargo build/test and the
  release workflow's tests leave GPUI out.
- tools/gui-shot.sh: runs the app on Xvfb with Mesa's software Vulkan and
  screenshots it, to check the GUI on Linux without a display.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 01:13:28 +03:00

156 lines
8.3 KiB
Markdown

# 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 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 |
| 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 and nfqws2's own learning of blocked sites |
| tg-ws-proxy | Flowseal's [tg-ws-proxy](https://github.com/Flowseal/tg-ws-proxy), the headless proxy, on a bundled Python |
| TUN | sing-box's TUN (wintun), `proxy-ctl proxy tun on` — **see the caveats** |
Not in this release, still to come: the desktop app (GPUI, with a tray icon), AmneziaWG,
WARP, Tor, the SSH tunnel, whitelist-bypass, the kill switch, server inbounds, the XRay-only
backend, zapret2's extended detection and z2k strategies.
## 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 |
**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.
## Install
1. Unzip `ProxySuite-<version>-windows-x64.zip` anywhere.
2. Run `install.cmd` (it asks for administrator rights). It copies the program to
`C:\Program Files\ProxySuite`, registers the **ProxySuite** service (starts at boot), adds
`proxy-ctl` to PATH and starts it.
3. Open a **new** terminal: `proxy-ctl status`.
To upgrade, unzip the new release and run its `install.cmd`. To remove, run `uninstall.cmd`;
the configuration and state stay in `%ProgramData%\ProxySuite` until you delete it.
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
```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
proxy-ctl logs -f # everything, following
proxy-ctl --help
```
## The configuration
`proxy-ctl config get` prints it, `proxy-ctl config set <file>` replaces it (checked first; a
bad one changes nothing), `proxy-ctl config validate <file>` 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 desktop app, which is not in this release)
- `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).
## 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 release zip, in dist/
nix shell nixpkgs#wineWow64Packages.stable -c tools/winws-dry-run.sh dist/ProxySuite-*/components
```
The Windows programs are cross-compiled with `cargo xwin` (MSVC target), with the toolchain
in `rust-toolchain.toml`. 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/<version>.md`, push a tag `windows-v<version>`. The
workflow tests, packages and publishes the zip and its `.sha256` with the `RELEASE_TOKEN`
secret (a token with `write:repository`). Run by hand, it only builds.