()
| 8 | * If the http(s)_proxy environment variables is set, return a proxy agent. |
| 9 | */ |
| 10 | export function getProxyAgent(): Agent | undefined { |
| 11 | const httpsProxy = process.env['https_proxy'] || process.env['HTTPS_PROXY'] |
| 12 | if (httpsProxy) { |
| 13 | return new HttpsProxyAgent(httpsProxy) |
| 14 | } |
| 15 | |
| 16 | const httpProxy = process.env['http_proxy'] || process.env['HTTP_PROXY'] |
| 17 | if (httpProxy) { |
| 18 | return new HttpProxyAgent(httpProxy) |
| 19 | } |
| 20 | } |