【功能建议】自定义供应商支持按供应商配置代理(Per-Provider Proxy)
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
背景
多渠道用户的自定义供应商通常混有两类端点:国内可直连的(如 zai-start-plan、自托管网关)和必须走代理的海外端点(部分海外第三方 API 平台)。当前 HTTP 代理为应用级全局设置(《HTTP 代理的作用范围》文档确认没有按供应商粒度),带来两个问题:
- 全局代理开启时,所有供应商流量都绑定到代理客户端;代理客户端退出或切换节点时,全部请求一起失败——包括本可直连的官方通道;
- 无法表达"供应商 A 走代理、供应商 B 直连"的混合需求。
实测:zcode.z.ai / api.z.ai 在无代理时可直接连通(307/301 响应),但全局代理开启后被强制绕行;代理客户端关闭后,连主力通道也随之中断。
期望方案(按优先级)
- 模型设置的每个自定义供应商增加可选的"代理地址"字段(留空 = 直连);
- 或每个供应商支持独立的 NoProxy 域名后缀列表;
- 或在文档中提供混合场景(部分渠道需代理、部分直连)的官方部署建议。
业界先例
- CC Switch(farion1231/cc-switch,132k★):Proxy & Failover 支持 "App-level takeover — Independently proxy Claude, Codex, Gemini, or Grok Build, down to individual providers"(按供应商独立代理),并配套热切换、熔断与健康检查;
- CCX(BenedictKing/ccx):每渠道独立代理(per-channel proxy)+ 密钥轮换 + 自定义请求头;
- New API / one-api:渠道 Setting 支持
{"proxy":"http://..."}渠道级代理。
当前用户的 workaround 是为需要代理的渠道额外架一层自建网关(在 New API 渠道 Setting 配置 proxy),多一层组件与维护成本——希望 ZCode 原生支持后可以省掉这一层。
环境信息
- ZCode 桌面版 3.12.1(Windows 11)
- 使用场景:多渠道混用(官方 zai 套餐直连 + AutoClaw 本地网关直连 + 海外第三方 API 平台走代理)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files, tests, or implementation entry points are identified in the issue. Start by locating the desktop application's HTTP proxy configuration and custom-provider model, then determine how provider-specific proxy settings should coexist with the global proxy. Done means documenting and implementing a clear per-provider proxy or bypass behavior for mixed direct and proxied channels.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100