Skip to content

Commit ccbe204

Browse files
committed
feat: node global proxy
1 parent e647549 commit ccbe204

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@xmz-ai/sandbox-runtime",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Xmz Sandbox Runtime - A general-purpose tool for wrapping security boundaries around arbitrary processes",
55
"type": "module",
66
"main": "./dist/index.js",
@@ -30,6 +30,7 @@
3030
"@pondwader/socks5-server": "^1.0.10",
3131
"@types/lodash-es": "^4.17.12",
3232
"commander": "^12.1.0",
33+
"global-agent": "^3.0.0",
3334
"lodash-es": "^4.17.21",
3435
"shell-quote": "^1.8.3",
3536
"zod": "^3.24.1"

src/node-proxy-boot.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'global-agent/bootstrap.js'

src/sandbox/sandbox-utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export const RESERVED_ENV_VARS = new Set([
4646
'CLOUDSDK_PROXY_PORT',
4747
'CLAUDE_CODE_HOST_HTTP_PROXY_PORT',
4848
'CLAUDE_CODE_HOST_SOCKS_PROXY_PORT',
49+
'GLOBAL_AGENT_HTTP_PROXY',
50+
'GLOBAL_AGENT_NO_PROXY',
4951
'SANDBOX_RUNTIME',
5052
'TMPDIR',
5153
])
@@ -190,13 +192,15 @@ export function generateProxyEnvVars(
190192
].join(',')
191193
envVars.push(`NO_PROXY=${noProxyAddresses}`)
192194
envVars.push(`no_proxy=${noProxyAddresses}`)
195+
envVars.push(`GLOBAL_AGENT_NO_PROXY=${noProxyAddresses}`)
193196

194197
if (httpProxyPort) {
195198
envVars.push(`HTTP_PROXY=http://localhost:${httpProxyPort}`)
196199
envVars.push(`HTTPS_PROXY=http://localhost:${httpProxyPort}`)
197200
// Lowercase versions for compatibility with some tools
198201
envVars.push(`http_proxy=http://localhost:${httpProxyPort}`)
199202
envVars.push(`https_proxy=http://localhost:${httpProxyPort}`)
203+
envVars.push(`GLOBAL_AGENT_HTTP_PROXY=http://localhost:${httpProxyPort}`)
200204
}
201205

202206
if (socksProxyPort) {

0 commit comments

Comments
 (0)