Proxy formats
cac supports multiple proxy formats. Pass them with the-p flag:
| Format | Example |
|---|---|
| Compact with auth | 1.2.3.4:1080:user:pass |
| Compact without auth | 1.2.3.4:1080 |
| Explicit SOCKS5 | socks5://user:pass@host:port |
| Explicit HTTP | http://host:port |
| Explicit HTTPS | https://host:port |
Protocol auto-detection
When you use the compact format (host:port:user:pass), cac automatically probes the proxy to detect the protocol:
- Try HTTP
- Try SOCKS5
- Try HTTPS
- Fall back to HTTP if all fail
TUN conflicts
If you run TUN-mode proxy software (Clash, Surge, sing-box, V2Ray), it captures all traffic — including cac’s proxy connections. This creates a double-proxy loop. cac handles this automatically: when it detects a TUN interface (tun* or utun*), it starts a local TCP relay on 127.0.0.1. Loopback traffic bypasses TUN, so the relay connects directly to your remote proxy.
Health check bypass
Claude Code pingsapi.anthropic.com/api/hello at startup. Through a proxy, Cloudflare returns 403 due to Node.js TLS fingerprint rejection (JA3/JA4).
cac bypasses this with in-process Node.js interception: https.request and fetch calls to that URL are patched to return a fake HTTP 200 immediately — no local server, no port binding, no root needed. This is automatic and produces no network traffic.