Chain Engine
Chain Engine
Saved chain definitions, policies, local runtime endpoints, fallback, health, and traffic logs.
The Chain Engine turns saved proxy chains into local HTTP/CONNECT proxy endpoints.
What It Manages
| Object | Purpose |
|---|---|
| Chain | A saved ordered list of proxy hops with labels, tags, and fallback chain IDs. |
| Policy | Runtime behavior such as validation, auth, timeout, health checks, retry budget, fallback, and bandwidth limit. |
| Runtime | A local endpoint bound to 127.0.0.1 that sends traffic through the saved chain route. |
| Traffic entry | Recent request/tunnel record with target, status, bytes, route, duration, and error details. |
Typical Flow
- Test candidates in Test Proxy Chains.
- Save a working chain in Chain Engine -> Chains.
- Attach the Balanced policy or create a custom policy.
- Start the runtime on a local port.
- Configure a client to use
http://127.0.0.1:<port>. - Watch Chain Engine -> Traffic.
Runtime States
| State | Meaning |
|---|---|
| Stopped | No listener is active. |
| Starting | Runtime is preparing routes and binding a local port. |
| Running | Runtime has an active local endpoint. |
| Degraded | Runtime started, but route health is not fully clean. |
| Error | Runtime could not start or continue. |
Tiny Features
| Feature | Detail |
|---|---|
| Persistent definitions | Chains, policies, and runtime configs are stored locally as JSON-backed state. |
| Fallback graph | The engine validates missing fallback chains and fallback cycles before runtime use. |
| Port fallback | If the requested local port is busy, the runtime binds a random local port and records a notice. |
| Health loop | Routes are probed on the policy interval and can be marked unhealthy after the failure threshold. |
| Active route refresh | Runtime route selection refreshes after health updates. |
| Optional local auth | Basic proxy auth protects the local endpoint when enabled in policy. |
| Bandwidth cap | Chain runtime can enforce a bandwidth limit and return status 509 when reached. |
| Traffic memory | Latest 500 traffic entries include target, status, bytes, route, duration, success, error, and timestamps. |
The Chain Engine is for durable local operation. Use Chain Tester first when you only need to evaluate chain candidates.