Skip to content

Route local API requests through the proxy when it runs - #12

Merged
redacid merged 1 commit into
mainfrom
feat/api-through-proxy
Dec 2, 2026
Merged

redacid merged 1 commit into
mainfrom
feat/api-through-proxy

Conversation

@redacid

@redacid redacid commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Requests to the local API did not show up in the proxy: the tools run without the user's settings (for isolation), and the proxy routes the app writes live in those settings.

Now the route is passed per request:

  • Claude Code and Gemini CLI: HTTPS_PROXY, NODE_EXTRA_CA_CERTS, NO_PROXY in the tool's environment.
  • Codex: -c openai_base_url=<Codex listener>.

Only while our service holds the port (and, for the HTTPS proxy, the CA file exists); otherwise the request goes direct, as before. The API never starts or waits for the proxy.

Tested: make check (182 tests); Codex live through :8878 answered, mitmdump logged chatgpt.com. Claude Code and Gemini CLI not tested live.

The API runs each tool without the user's settings, so the proxy routes
the app writes into those settings (HTTPS_PROXY for Claude Code,
openai_base_url for Codex) were skipped and API traffic bypassed the
proxy. Pass the route per request instead: the HTTPS proxy, its CA and
NO_PROXY in the environment for Claude Code and Gemini CLI, and
-c openai_base_url for Codex. Only while our service holds the port
(and the CA exists), so a request never goes to a foreign listener;
otherwise it goes direct as before.
@redacid
redacid merged commit 7109f89 into main Dec 2, 2026
8 checks passed
redacid pushed a commit that referenced this pull request Dec 2, 2026
Version bump and changelog for routing local API requests through the proxy (#12).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant