Skip to content

feat: add upstream proxy support#6

Open
0x7551 wants to merge 1 commit intomotiful:mainfrom
0x7551:feat/upstream-proxy
Open

feat: add upstream proxy support#6
0x7551 wants to merge 1 commit intomotiful:mainfrom
0x7551:feat/upstream-proxy

Conversation

@0x7551
Copy link
Copy Markdown

@0x7551 0x7551 commented Apr 1, 2026

Summary

  • Add optional upstream.proxy config field for routing all outbound requests through an HTTP/SOCKS proxy
  • Supports both API proxy requests and OAuth token refresh
  • Useful for deployments behind corporate firewalls or restricted network environments

Changes

  • config.example.yaml / config.ts: new upstream.proxy optional field
  • proxy.ts: create HttpsProxyAgent and pass to upstream requests
  • oauth.ts: accept proxy URL and use agent for token refresh
  • index.ts: pass proxy config to initOAuth
  • New dependency: https-proxy-agent

Test plan

  • Start gateway without upstream.proxy set — verify behavior unchanged
  • Set upstream.proxy to a valid proxy — verify API and OAuth requests route through it
  • Set an invalid proxy URL — verify graceful error logging

🤖 Generated with Claude Code

Add optional `upstream.proxy` config field to route all outbound requests
(API proxy + OAuth token refresh) through an HTTP/SOCKS proxy, useful for
deployments behind a corporate firewall or in restricted network environments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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