CommandCodeAI / CommandCodeAI/command-code

WebSocket connections fail behind Fence sandbox (ignore HTTPS_PROXY)

未关闭
#625 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
没有语言数据
星标
4k
派生
350
PR 合并指标
30 天内没有已合并 PR

描述

Summary

When running Command Code inside popular sandbox tool Fence (https://github.com/fencesandbox/fence) (Linux sandbox using bwrap --unshare-net), all WebSocket connections time out. Fence routes network traffic through an HTTP proxy (HTTPS_PROXY=http://127.0.0.1:3128) since direct TCP is blocked by the network namespace.

curl, fetch, and HTTP requests work correctly. However, new WebSocket(url) (used in buildSandboxStreamUrl / defaultCreateSandboxStreamSocket) ignores proxy env vars and attempts a direct TCP connection, which is blocked by the sandbox.

The codebase already has detectProxyFromEnv(). Maybe use ws package with https-proxy-agent for WebSocket connections when a proxy is detected, instead of the built-in WebSocket

Expected Behavior

CommandCode working inside Fence sandboxing

Actual Behavior

Connection issues with Fence. Can't use CommandCode with it.

Steps to reproduce the issue
  1. Install and configure Fence ( https://github.com/fencesandbox/fence )
  2. Run CommandCode with "fence cmd"
Command Code Version

1.10.0

Operating System

Linux

Terminal/IDE

JetBrains-JediTerm

Shell

bwrap

Session file (optional)

No response

Fix prompt (optional)

No response

Additional context

No response

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 buildSandboxStreamUrl 和 defaultCreateSandboxStreamSocket,然后检查 detectProxyFromEnv 如何用于现有的 HTTP 请求。重现 Fence sandbox 失败的问题,并验证 WebSocket 连接能够通过配置的 HTTPS_PROXY 成功连接,同时不破坏直接连接。

由索引模型根据 Issue 内容生成。

评估

领域
cli, networking
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。