proxy-agent
Advanced tools
Comparing version 6.1.2 to 6.2.0
@@ -85,2 +85,3 @@ "use strict"; | ||
opts?.httpsAgent || new https.Agent(opts); | ||
this.getProxyForUrl = opts?.getProxyForUrl || proxy_from_env_1.getProxyForUrl; | ||
} | ||
@@ -92,3 +93,3 @@ async connect(req, opts) { | ||
const url = new URL(req.path, `${protocol}//${host}`).href; | ||
const proxy = (0, proxy_from_env_1.getProxyForUrl)(url); | ||
const proxy = this.getProxyForUrl(url); | ||
if (!proxy) { | ||
@@ -95,0 +96,0 @@ debug('Proxy not enabled for URL: %o', url); |
@@ -12,2 +12,3 @@ /// <reference types="node" /> | ||
type AgentConstructor = new (...args: never[]) => Agent; | ||
type GetProxyForUrlCallback = (url: string) => string; | ||
/** | ||
@@ -32,2 +33,8 @@ * Supported proxy types. | ||
httpsAgent?: http.Agent; | ||
/** | ||
* A callback for dynamic provision of proxy for url. | ||
* Defaults to standard proxy environment variables, | ||
* see https://www.npmjs.com/package/proxy-from-env for details | ||
*/ | ||
getProxyForUrl?: GetProxyForUrlCallback; | ||
}; | ||
@@ -49,2 +56,3 @@ /** | ||
httpsAgent: http.Agent; | ||
getProxyForUrl: GetProxyForUrlCallback; | ||
constructor(opts?: ProxyAgentOptions); | ||
@@ -51,0 +59,0 @@ connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<http.Agent>; |
@@ -85,2 +85,3 @@ "use strict"; | ||
opts?.httpsAgent || new https.Agent(opts); | ||
this.getProxyForUrl = opts?.getProxyForUrl || proxy_from_env_1.getProxyForUrl; | ||
} | ||
@@ -92,3 +93,3 @@ async connect(req, opts) { | ||
const url = new URL(req.path, `${protocol}//${host}`).href; | ||
const proxy = (0, proxy_from_env_1.getProxyForUrl)(url); | ||
const proxy = this.getProxyForUrl(url); | ||
if (!proxy) { | ||
@@ -95,0 +96,0 @@ debug('Proxy not enabled for URL: %o', url); |
{ | ||
"name": "proxy-agent", | ||
"version": "6.1.2", | ||
"version": "6.2.0", | ||
"description": "Maps proxy protocols to `http.Agent` implementations", | ||
@@ -34,3 +34,3 @@ "main": "./dist/index.js", | ||
"lru-cache": "^7.14.1", | ||
"pac-proxy-agent": "^6.0.1", | ||
"pac-proxy-agent": "^6.0.2", | ||
"proxy-from-env": "^1.1.0", | ||
@@ -37,0 +37,0 @@ "socks-proxy-agent": "^8.0.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22947
309
Updatedpac-proxy-agent@^6.0.2