Socket
Socket
Sign inDemoInstall

proxy-agent

Package Overview
Dependencies
42
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.0 to 6.1.0

5

./dist/index.js

@@ -82,2 +82,5 @@ "use strict";

this.connectOpts = opts;
this.httpAgent = opts?.httpAgent || new http.Agent(opts);
this.httpsAgent =
opts?.httpsAgent || new https.Agent(opts);
}

@@ -91,3 +94,3 @@ async connect(req, opts) {

debug('Proxy not enabled for URL: %o', url);
return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
return opts.secureEndpoint ? this.httpsAgent : this.httpAgent;
}

@@ -94,0 +97,0 @@ debug('Request URL: %o', url);

17

dist/index.d.ts

@@ -17,3 +17,16 @@ /// <reference types="node" />

};
export type ProxyAgentOptions = HttpProxyAgentOptions<''> & HttpsProxyAgentOptions<''> & SocksProxyAgentOptions & PacProxyAgentOptions<''>;
export type ProxyAgentOptions = HttpProxyAgentOptions<''> & HttpsProxyAgentOptions<''> & SocksProxyAgentOptions & PacProxyAgentOptions<''> & {
/**
* Default `http.Agent` instance to use when no proxy is
* configured for a request. Defaults to a new `http.Agent()`
* instance with the proxy agent options passed in.
*/
httpAgent?: http.Agent;
/**
* Default `http.Agent` instance to use when no proxy is
* configured for a request. Defaults to a new `https.Agent()`
* instance with the proxy agent options passed in.
*/
httpsAgent?: http.Agent;
};
/**

@@ -32,2 +45,4 @@ * Uses the appropriate `Agent` subclass based off of the "proxy"

connectOpts?: ProxyAgentOptions;
httpAgent: http.Agent;
httpsAgent: http.Agent;
constructor(opts?: ProxyAgentOptions);

@@ -34,0 +49,0 @@ connect(req: http.ClientRequest, opts: AgentConnectOpts): Promise<http.Agent>;

@@ -82,2 +82,5 @@ "use strict";

this.connectOpts = opts;
this.httpAgent = opts?.httpAgent || new http.Agent(opts);
this.httpsAgent =
opts?.httpsAgent || new https.Agent(opts);
}

@@ -91,3 +94,3 @@ async connect(req, opts) {

debug('Proxy not enabled for URL: %o', url);
return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
return opts.secureEndpoint ? this.httpsAgent : this.httpAgent;
}

@@ -94,0 +97,0 @@ debug('Request URL: %o', url);

{
"name": "proxy-agent",
"version": "6.0.0",
"version": "6.1.0",
"description": "Maps proxy protocols to `http.Agent` implementations",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc