(protocol: string)
| 6 | * @returns The proxy URL if available, otherwise undefined |
| 7 | */ |
| 8 | export function getProxyFromEnv(protocol: string): string | undefined { |
| 9 | if (protocol === "https:") { |
| 10 | return ( |
| 11 | process.env.HTTPS_PROXY || |
| 12 | process.env.https_proxy || |
| 13 | process.env.HTTP_PROXY || |
| 14 | process.env.http_proxy |
| 15 | ); |
| 16 | } else { |
| 17 | return process.env.HTTP_PROXY || process.env.http_proxy; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | // Note that request options proxy (per model) takes precedence over environment variables |
| 22 | export function getProxy( |
no outgoing calls
no test coverage detected