Smart Fallback Proxy
Added in v4.0.0, the Smart Proxy automatically selects the best working encrypted DNS protocol and switches to another if it gets blocked. This is designed for environments where protocols are frequently disrupted.Protocol Cascade
The proxy tries protocols in this order:- DoH (DNS over HTTPS) — Hardest to block, looks like web traffic
- DoT (DNS over TLS) — Lower overhead, uses port 853
- DNSCrypt — Encrypted from first packet, no CA dependency
- Sing-box — VLESS/REALITY, VMess, Trojan, etc. (when configured)
- Plain DNS — Last resort fallback
Sing-box protocols (VLESS/REALITY, etc.) can be added to the cascade by providing
a sing-box configuration. These protocols offer the strongest anti-censorship
protection for users in Iran and similar regions.
How It Works
- Startup probe — Tests all available protocols and selects the fastest working one
- Health monitoring — Checks the active protocol every 30 seconds
- Failure counting — After 3 consecutive failures, probes for a new protocol
- Auto-switch — Seamlessly switches to the next working protocol
- Notification — Logs protocol switches so you know what’s happening
Interactive Mode
From the main menu, select [10] Smart Proxy (Auto-Fallback):- Configure the listen address (default:
127.0.0.1:5354) - The proxy probes protocols and starts automatically
- Return to the menu to view status or stop the proxy
CLI Mode
Configuration
| Flag | Default | Description |
|---|---|---|
--listen | 127.0.0.1:5354 | Local address:port to listen on |
--protocol | auto | Preferred protocol: auto, doh, dot, dnscrypt |
--fragment | none | TLS fragment mode: none, sni, half, chunked |
--json | false | Output status as JSON |
Using with Sing-box
When sing-box is configured, it becomes part of the fallback cascade:- Try DoH/DoT/DNSCrypt first
- Fall back to sing-box (VLESS/REALITY, etc.) if configured
- Use plain DNS as last resort