As upstream's sampler and slow judge: every minute, eleven Clash API snapshots a second apart; a site whose best direct transfer never beat slowBelowKiBps three times is owed an exit, and gets the first, in probe order, that answers it as well as direct does (probe --via); routed slow, it moves on after crawling twice there, and with no exit left it stays direct for a TTL. Here the Clash API is always on, so it works whatever the selection. The app's autoProxy page: on or off, a site probed or learned, the sites routed (forget one or all), the exits (bad ones marked), the exclusions and the slowness threshold. tools/screenshots.sh takes every page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
71 lines
3.4 KiB
Bash
Executable File
71 lines
3.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Screenshots of every page of the app, for the README: the service on Linux with a demo
|
|
# configuration (a local Shadowsocks exit, zapret's presets from a built release, autoProxy,
|
|
# whitelist-bypass, the Telegram proxy), the app on a virtual display (tools/gui-shot.sh).
|
|
# In the dev shell, after tools/package.sh:
|
|
#
|
|
# tools/screenshots.sh [OUT_DIR] (OUT_DIR: docs/screenshots)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
OUT=$(realpath -m "${1:-docs/screenshots}")
|
|
mkdir -p "$OUT"
|
|
WORK=$(mktemp -d)
|
|
STATE=$WORK/state
|
|
SOCK=${XDG_RUNTIME_DIR:-/tmp}/proxy-suite-shots.sock
|
|
rm -f "$SOCK"
|
|
mkdir -p "$STATE/bin"
|
|
port() { python3 -c 'import socket;s=socket.socket();s.bind(("127.0.0.1",0));print(s.getsockname()[1])'; }
|
|
SS=$(port) PROXY=$(port) CLASH=$(port) TEST=$(port)
|
|
KEY=a2tra2tra2tra2tra2traw==
|
|
cat >"$WORK/server.json" <<JSON
|
|
{ "log": { "level": "warn" },
|
|
"inbounds": [{ "type": "shadowsocks", "listen": "127.0.0.1", "listen_port": $SS, "method": "2022-blake3-aes-128-gcm", "password": "$KEY" }],
|
|
"dns": { "servers": [{ "type": "https", "tag": "local", "server": "1.1.1.1" }] },
|
|
"outbounds": [{ "type": "direct" }], "route": { "default_domain_resolver": "local" } }
|
|
JSON
|
|
sing-box run -c "$WORK/server.json" >/dev/null 2>&1 &
|
|
SERVER=$!
|
|
SS_URL="ss://2022-blake3-aes-128-gcm:${KEY//=/%3D}@127.0.0.1:$SS"
|
|
cat >"$STATE/config.json" <<JSON
|
|
{ "proxy": { "enable": true, "listener": { "port": $PROXY },
|
|
"singBox": { "clashApiPort": $CLASH, "testPort": $TEST },
|
|
"selection": "urltest",
|
|
"routing": { "directRu": false,
|
|
"rules": [{ "name": "streaming", "outbound": "Netherlands", "domains": ["youtube.com", "googlevideo.com"] }] },
|
|
"autoProxy": { "enable": true, "slowBelowKiBps": 0 },
|
|
"outbounds": [{ "tag": "Netherlands", "url": "$SS_URL#Netherlands" },
|
|
{ "tag": "Germany", "url": "$SS_URL#Germany" },
|
|
{ "tag": "Finland", "url": "$SS_URL#Finland" }] },
|
|
"zapret": { "enable": true, "engine": "zapret-discord-youtube",
|
|
"zapret-discord-youtube": { "configName": "general (ALT9)", "gameFilter": "all" } },
|
|
"tgWsProxy": { "enable": false },
|
|
"whitelistBypass": { "enable": true,
|
|
"joiners": { "wl": { "platform": "wbstream" } },
|
|
"creators": { "office": { "platform": "bitrix" } } } }
|
|
JSON
|
|
release=$(ls -d dist/ProxySuite-*-windows-x64/components 2>/dev/null | tail -1 || true)
|
|
[ -n "$release" ] && cp -r "$release/zapret" "$STATE/bin/" 2>/dev/null || true
|
|
cargo build -q -p ps-service -p ps-gui
|
|
target/debug/proxy-suite-service --console --state-dir "$STATE" --socket "$SOCK" >"$WORK/service.log" 2>&1 &
|
|
SERVICE=$!
|
|
trap 'kill $SERVICE $SERVER 2>/dev/null || true; rm -rf "$WORK"' EXIT
|
|
for _ in $(seq 60); do target/debug/proxy-ctl --socket "$SOCK" status 2>/dev/null | grep -q 'proxy: active' && break; sleep 0.5; done
|
|
# Something for the Logs and Outbounds pages to show: delays, a few lines.
|
|
target/debug/proxy-ctl --socket "$SOCK" proxy outbounds test >/dev/null 2>&1 || true
|
|
|
|
# Sidebar entries, top to bottom (points on a 1280x820 screen).
|
|
shot() {
|
|
local name=$1 y=$2 extra=${3:-}
|
|
SHOT_STEPS="click:197,$y wait:2 $extra" tools/gui-shot.sh "$OUT/$name.png" 8 -- --socket "$SOCK" >/dev/null
|
|
echo "$OUT/$name.png"
|
|
}
|
|
shot overview 162
|
|
shot dpi-bypass 198
|
|
shot telegram 234
|
|
shot whitelist-bypass 270
|
|
shot outbounds 306
|
|
shot autoproxy 342
|
|
shot logs 378
|
|
shot settings 414
|
|
shot components 450
|