{"version":3,"file":"proxy-agent.mjs","names":[],"sources":["../src/proxy-agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                       ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Agent } from \"node:https\";\nimport { HttpProxyAgent } from \"./http-proxy\";\nimport { HttpsProxyAgent } from \"./https-proxy\";\n\n/**\n * If the http(s)_proxy environment variables is set, return a proxy agent.\n *\n * @returns The proxy agent or undefined if no proxy is set.\n */\nexport function getProxyAgent(): Agent | undefined {\n  const httpsProxy = process.env.https_proxy || process.env.HTTPS_PROXY;\n  if (httpsProxy) {\n    return new HttpsProxyAgent(httpsProxy);\n  }\n\n  const httpProxy = process.env.http_proxy || process.env.HTTP_PROXY;\n  if (httpProxy) {\n    return new HttpProxyAgent(httpProxy);\n  }\n\n  return undefined;\n}\n"],"mappings":";;;;;;;;;AA2BA,SAAgB,gBAAmC;CACjD,MAAM,aAAa,QAAQ,IAAI,eAAe,QAAQ,IAAI;AAC1D,KAAI,WACF,QAAO,IAAI,gBAAgB,WAAW;CAGxC,MAAM,YAAY,QAAQ,IAAI,cAAc,QAAQ,IAAI;AACxD,KAAI,UACF,QAAO,IAAI,eAAe,UAAU"}