-
Notifications
You must be signed in to change notification settings - Fork 204
Description
In many enterprise environments, internet access to external services may need to be routed through HTTP/HTTPS proxies for security and monitoring. This requires applications to be aware of and use these proxies when making network requests.
Proxy settings are often provided via environment variables such as HTTP_PROXY, HTTPS_PROXY, and NO_PROXY.
But when I set these variables to access our Gitlab server through our proxy server, Sourcebot generate this error:
[backend] | 2026-01-16T21:14:13.021Z �[31merror�[39m: [gitlab] Failed to fetch projects for group my-group. fetch failed
[backend] | TypeError: fetch failed
[backend] | at node:internal/deps/undici/undici:13392:13
[backend] | at processTicksAndRejections (node:internal/process/task_queues:95:5)
[backend] | at runNextTicks (node:internal/process/task_queues:64:3)
[backend] | at process.processImmediate (node:internal/timers:454:9)
[backend] | at async defaultRequestHandler (file:///app/node_modules/@gitbeaker/rest/dist/index.mjs:67:22)
[backend] | at async file:///app/node_modules/@gitbeaker/core/dist/index.mjs:99:22
[backend] | at async fetchWithRetry (file:///app/packages/backend/dist/utils.js:69:20)
[backend] | at async measure (file:///app/packages/backend/dist/utils.js:9:18)
[backend] | at async file:///app/packages/backend/dist/gitlab.js:75:46
[backend] | at async Promise.allSettled (index 0)
It would be great if we can use an HTTP Proxy with Sourcebot.
If it can help, Node.js supports HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables when NODE_USE_ENV_PROXY variable or --use-env-proxy CLI option is enabled. This works with node:http and node:https (v22.21.0 or v24.5.0+) methods as well as fetch() (v22.21.0 or v24.0.0+):
https://nodejs.org/en/learn/http/enterprise-network-configuration#proxy-configuration