docs: update README with MITM setup and extension patch instructions

This commit is contained in:
Nikketryhard
2026-02-14 04:03:25 -06:00
parent 9cf7bb75d2
commit de9be0d564

View File

@@ -129,10 +129,17 @@ Built-in MITM proxy intercepts LS ↔ Google/Anthropic traffic to capture **real
# 1. Start proxy (generates CA cert automatically)
RUST_LOG=info ./target/release/antigravity-proxy
# 2. Install wrapper (patches LS binary to route through MITM)
# 2. Patch extension to enable proxy detection (required!)
# The LS has a protobuf field `detect_and_use_proxy` that defaults to UNSPECIFIED,
# which means it ignores HTTPS_PROXY for LLM API calls. This patch sets it to ENABLED (1).
# Must be re-applied after every Antigravity update.
sudo sed -i 's/detectAndUseProxy=pe.UNSPECIFIED/detectAndUseProxy=1/' \
/usr/share/antigravity/resources/app/extensions/antigravity/dist/extension.js
# 3. Install wrapper (patches LS binary to route through MITM)
./scripts/mitm-wrapper.sh install
# 3. Restart Antigravity — done!
# 4. Restart Antigravity — done!
# Check status
./scripts/mitm-wrapper.sh status
@@ -141,6 +148,14 @@ RUST_LOG=info ./target/release/antigravity-proxy
./scripts/mitm-wrapper.sh uninstall
```
### Extension Patch Details
The LS uses `daily-cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse` for LLM API calls (regular HTTPS+SSE, NOT gRPC). The LS binary checks a protobuf field (`detect_and_use_proxy`, field 34 on init metadata) to decide whether to honor `HTTPS_PROXY`. The extension defaults this to `UNSPECIFIED` (ignore proxy). The sed patch above changes it to `ENABLED` (value `1`), allowing the MITM wrapper's env vars to take effect.
**Verify patch:** `grep -o 'detectAndUseProxy=[^;]*' /usr/share/antigravity/resources/app/extensions/antigravity/dist/extension.js` should show `detectAndUseProxy=1`.
**Model IDs** (for standalone LS testing): `MODEL_PLACEHOLDER_M18` = Gemini 3 Flash, `MODEL_PLACEHOLDER_M8` = Gemini 3 Pro (High), `MODEL_PLACEHOLDER_M7` = Gemini 3 Pro (Low), `MODEL_PLACEHOLDER_M26` = Claude Opus 4.6, `MODEL_PLACEHOLDER_M12` = Claude Opus 4.5, `MODEL_CLAUDE_4_5_SONNET` = Claude Sonnet 4.5.
### Usage Stats
```bash