feat(cli): add edgee relay MITM proxy rerouting inference through the gateway#123
Open
SachaMorard wants to merge 3 commits into
Open
feat(cli): add edgee relay MITM proxy rerouting inference through the gateway#123SachaMorard wants to merge 3 commits into
edgee relay MITM proxy rerouting inference through the gateway#123SachaMorard wants to merge 3 commits into
Conversation
KokaKiwi
requested changes
Jun 30, 2026
e0108f6 to
b974f73
Compare
…gh the gateway `edgee relay [agent]` runs a local MITM proxy that reroutes LLM inference requests to the Edgee gateway (with x-edgee-* auth injected) and optionally logs the traffic. Gives local visibility into requests that otherwise go straight to the gateway. - Reroutes /v1/messages, /v1/responses, /v1/chat/completions, and Codex's /backend-api/codex/responses (remapped to /v1/responses). - Injects the agent's Edgee key: claude for `relay claude` / proxy-only, codex for `relay codex`. Per-agent default ports (claude 41100, codex 41200) so the two run side by side without `--port`. - Per-agent CA trust: NODE_EXTRA_CA_CERTS (Node/Claude) + CODEX_CA_CERTIFICATE (Rust/Codex). - Opt-in logging via --log-output <file> (request+response, full bodies, decoded, req↔response correlation ids). - `edgee launch claude --relay` delegates to the relay. - Gated behind the `relay` feature (in default). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b974f73 to
cfe7c03
Compare
Wire up Cursor as a relay target: - Add BidiAppend and RunSSE Connect-RPC paths to REROUTE_MAP so the relay intercepts Cursor AI traffic and injects x-edgee-upstream-url - Add --proxy-server flag when launching Cursor: Electron's net module ignores HTTPS_PROXY env vars and requires this CLI flag instead - Add is_cursor / is_gui_editor helpers, port 41300, cursor key lookup, and per-editor hint text (co-authored with pre-existing stubs)
cfe7c03 to
f6d12a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
edgee relay [agent]— a local MITM proxy that reroutes LLM inference to the Edgee gateway and optionally logs the traffic, giving local visibility into requests that otherwise go straight to the gateway.How it works
rcgen), intercepts viahudsucker.x-edgee-api-key/x-edgee-session-id/x-edgee-repo:/v1/messages,/v1/responses,/v1/chat/completions→ same path on gateway/backend-api/codex/responses(Codex ChatGPT backend) → remapped to/v1/responsesKey & ports per agent
relay claude/ proxy-only, codex forrelay codex(keys differ per provider — they carry per-agent compression/routing settings).--port: claude 41100, codex 41200.Usage
Running
relay claudeandrelay codexconcurrently works out of the box: each spawned agent routes only through its own relay (itsHTTPS_PROXY), so keys never cross.CA trust
NODE_EXTRA_CA_CERTS(Node/Claude) andCODEX_CA_CERTIFICATE(Codex/Rust). Codex's own client ignoresNODE_EXTRA_CA_CERTS, hence the dedicated var.Logging (opt-in via
--log-output <file>)#N) so parallel/interleaved traffic stays readable.Notes
relayfeature (indefault). Build depaws-lc-rsneeds a C toolchain (+ NASM on Windows); can fall back toringif needed. No OS-specific code otherwise (paths viaetcetera, binary resolution handles Windows).Tests
cargo fmt/clippy/testclean (default +--features relay).🤖 Generated with Claude Code