Cowork WebFetch 无法访问外部网络 - Claude Desktop
Quick fix
在 CC Switch 生成的 3P gateway profile 中加入 "coworkEgressAllowedHosts": ["*"],允许 Cowork sandbox 访问外部主机。
Symptom
Section titled “Symptom”WebFetch 访问外部 URL 失败。Claude Desktop 在第三方(3P)模式下通过 CC Switch 本地网关转发请求。Cowork 的 WebFetch 运行在 sandbox 中,是否能访问外部网络取决于 3P gateway profile 里的 `coworkEgressAllowedHosts` 配置。若该配置缺失或未放开,Cowork sandbox 无法访问任意外部主机,WebFetch 就会失败。
Issue #3171 中维护者/用户确认:当 CC Switch 生成的 3P gateway profile 中包含 `"coworkEgressAllowedHosts": ["*"]` 时,WebFetch 可以正常工作。本 cluster 中的其他 issue(Codex 无法识别、Ubuntu 安装破坏网络、API 无法切换、超大上下文 502)属于不同问题,仅作为来源列出,不适用于本页修复。
在 CC Switch 中配置第三方 Claude/Anthropic 兼容 Provider,并将其应用到 Claude Desktop,使 Claude Desktop 进入 3P 模式并通过 CC Switch 本地网关转发请求。
编辑 CC Switch 为该 Provider 生成的 3P gateway profile,在 JSON 中加入 `coworkEgressAllowedHosts`,允许 Cowork sandbox 访问外部主机。
CC Switch 生成的 3P gateway profile(具体路径未在 issue 中给出) {"coworkEgressAllowedHosts": ["*"]}保存配置后重新打开 Claude Desktop 的 Cowork,让 Cowork 使用 WebFetch 访问任意外部网页(例如公开文档页面或 `https://www.google.com`),确认能返回实际网页内容。
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”本页汇总自 5 个真实 issue
- 为什么 Cowork 的 WebFetch 在 Claude Desktop 3P 模式下不能访问外部网页?
- 因为 Cowork sandbox 的外部访问由 3P gateway profile 的 `coworkEgressAllowedHosts` 控制。若 CC Switch 生成的 profile 没有放开该列表,WebFetch 就无法访问外部主机。
- `coworkEgressAllowedHosts` 应该设置成什么值?
- Issue #3171 中确认设置为 `["*"]` 后 WebFetch 可以正常工作。该配置表示允许 Cowork sandbox 访问外部主机。
- 这个问题会影响 Codex、Ubuntu 网络或 API 切换吗?
- 不会。本 cluster 还包含 Codex 无法识别、Ubuntu 安装后网络丢失、无法切换 API、超大上下文 502 等报告,但它们是不同问题;本页只处理 Claude Desktop Cowork WebFetch 无法访问外部网络的情况。
这是一个非官方社区 wiki,与 cc-switch 作者及项目本身无隶属关系。内容整理自项目公开的 GitHub issues。本站不分发任何软件。