()
| 8 | let proxyConfigured = false; |
| 9 | |
| 10 | export function configureProxy() { |
| 11 | if (proxyConfigured) return; |
| 12 | |
| 13 | const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY || |
| 14 | process.env.http_proxy || process.env.https_proxy; |
| 15 | |
| 16 | if (!proxyUrl) { |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | // Use env-aware proxy resolution so runtime config can stay outside application code. |
| 21 | const envHttpProxyAgent = new EnvHttpProxyAgent(); |
| 22 | setGlobalDispatcher(envHttpProxyAgent); |
| 23 | |
| 24 | proxyConfigured = true; |
| 25 | } |
| 26 | |
| 27 | // Configure eagerly in dev/test to keep local behavior close to production startup. |
| 28 | if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") { |
no outgoing calls
no test coverage detected