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
- Install and configure Fence ( https://github.com/fencesandbox/fence )
- 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
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
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