Docs & API

Control WhaleProxy with code.

A local control plane: REST on port 8091, JSON-RPC over a named pipe, and a CLI — the same command set beneath the GUI.

Overview

The API is a machine-to-machine interface to the routing engine. The default base URL is http://127.0.0.1:8091/v1, JSON in/out. Enable it in the Settings tab.

By default it listens on loopback (127.0.0.1) only. You can bind it to a network IP for remote control — put it behind TLS + a firewall, since the engine runs elevated and controls all of the machine's network traffic.

Highlight: WhaleProxy can change the proxy of a running process — something no other per-process proxifier can do.

Authentication

Every request (except /v1/healthz) needs an API key, sent in a header. The key is CSPRNG-generated; create/rotate it in Settings → Generate. Keys are compared in constant time.

http
X-API-Key: <YOUR_API_KEY>
# hoặc
Authorization: Bearer <YOUR_API_KEY>

Reroute — change a running process's proxy

Select processes by pids, exe name, path, identity hash, or nickname — then point them at a new proxy. Use /preview to dry-run without applying.

POST/v1/rerouteReroute a running process
POST/v1/reroute/previewPreview which PIDs would match
POST/v1/reroute/clearClear reroute, revert to rules
POST /v1/reroute
{ "match": { "nickname": "Acc 3" }, "proxy": "jp-2" }

→ 200 { "rerouted": 1, "flows_moved": 12 }

Proxies

Manage the upstream pool (socks5 / http / localnet). Test returns latency and the real exit IP.

GET/v1/proxiesList proxies + status
POST/v1/proxiesAdd (single / batch)
POST/v1/proxies/{alias}:testTest → latency + exit IP
DELETE/v1/proxies/{alias}Delete + auto-rebalance

Rules

Persistent, first-match-wins rules applied to current and future processes.

GET/v1/rulesList the rule chain
POST/v1/rulesAdd a rule
POST/v1/rules/reorderReorder priority
POST/v1/config/reloadReload config, apply live

Processes

Inspect tracked processes, assign nicknames, or kill them.

GET/v1/processesLive process list
GET/v1/processes/{pid}Detail for one PID
POST/v1/processes/{pid}/nicknameSet a nickname
POST/v1/processes/{pid}/killKill the process

Stats & events

Read bytes/flows/connections per process and per proxy; long-poll spawn/exit events.

GET/v1/statsWhole-system totals
GET/v1/stats/per-proxyPer proxy
GET/v1/events/pollLong-poll events

Command line

The CLI wraps the same commands; add --json for machine-readable output. Runs while the engine is up.

cmd
$ whaleproxy proxies list --json
$ whaleproxy reroute --name chrome.exe --to jp-2
$ whaleproxy pin --nickname "Acc 3" --proxy us-1
$ whaleproxy stats --json

Example — call it from Python

The API is plain HTTP, callable from any language. The example below moves one account to a different proxy.

python
import requests

API = "http://127.0.0.1:8091/v1"
H   = { "X-API-Key": "YOUR_KEY" }

# Đổi proxy của "Acc 3" sang jp-2, ngay khi đang chạy
r = requests.post(f"{API}/reroute", headers=H, json={
    "match": { "nickname": "Acc 3" },
    "proxy": "jp-2"
})
print(r.json())  # {'rerouted': 1, 'flows_moved': 12}
Automate your farm

Reroute whole batches of accounts by script

Download WhaleProxy, enable the API in Settings, and start driving it with code.