proxy-chain
Advanced tools
Comparing version 0.1.28 to 0.1.29
@@ -193,12 +193,2 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'maybeAddProxyAuthorizationHeader', | ||
value: function maybeAddProxyAuthorizationHeader(headers) { | ||
var parsed = this.upstreamProxyUrlParsed; | ||
if (parsed && parsed.username) { | ||
var auth = parsed.username; | ||
if (parsed.password) auth += ':' + parsed.password; | ||
headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); | ||
} | ||
} | ||
@@ -205,0 +195,0 @@ /** |
@@ -116,3 +116,3 @@ 'use strict'; | ||
this.maybeAddProxyAuthorizationHeader(reqOpts.headers); | ||
(0, _tools.maybeAddProxyAuthorizationHeader)(this.upstreamProxyUrlParsed, reqOpts.headers); | ||
@@ -119,0 +119,0 @@ this.log('Connecting to upstream proxy ' + reqOpts.host + ':' + reqOpts.port); |
@@ -17,2 +17,4 @@ 'use strict'; | ||
var _tools = require('./tools'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -60,3 +62,3 @@ | ||
this.maybeAddProxyAuthorizationHeader(options.headers); | ||
(0, _tools.maybeAddProxyAuthorizationHeader)(this.upstreamProxyUrlParsed, options.headers); | ||
@@ -63,0 +65,0 @@ this.trgRequest = _http2.default.request(options); |
@@ -13,2 +13,4 @@ 'use strict'; | ||
var _tools = require('./tools'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -77,3 +79,3 @@ | ||
this.maybeAddProxyAuthorizationHeader(options.headers); | ||
(0, _tools.maybeAddProxyAuthorizationHeader)(this.upstreamProxyUrlParsed, options.headers); | ||
@@ -189,12 +191,2 @@ this.trgRequest = _http2.default.request(options); | ||
} | ||
}, { | ||
key: 'maybeAddProxyAuthorizationHeader', | ||
value: function maybeAddProxyAuthorizationHeader(headers) { | ||
var parsed = this.upstreamProxyUrlParsed; | ||
if (parsed && parsed.username) { | ||
var auth = parsed.username; | ||
if (parsed.password) auth += ':' + parsed.password; | ||
headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); | ||
} | ||
} | ||
@@ -201,0 +193,0 @@ /** |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.findFreePort = exports.PORT_SELECTION_CONFIG = exports.addHeader = exports.parseProxyAuthorizationHeader = exports.redactParsedUrl = exports.redactUrl = exports.parseUrl = exports.isInvalidHeader = exports.isHopByHopHeader = exports.parseHostHeader = undefined; | ||
exports.maybeAddProxyAuthorizationHeader = exports.findFreePort = exports.PORT_SELECTION_CONFIG = exports.addHeader = exports.parseProxyAuthorizationHeader = exports.redactParsedUrl = exports.redactUrl = exports.parseUrl = exports.isInvalidHeader = exports.isHopByHopHeader = exports.parseHostHeader = undefined; | ||
@@ -213,2 +213,10 @@ var _url = require('url'); | ||
}); | ||
}; | ||
var maybeAddProxyAuthorizationHeader = exports.maybeAddProxyAuthorizationHeader = function maybeAddProxyAuthorizationHeader(parsedUrl, headers) { | ||
if (parsedUrl && parsedUrl.username) { | ||
var auth = parsedUrl.username; | ||
if (parsedUrl.password || parsedUrl.password === '') auth += ':' + parsedUrl.password; | ||
headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(auth).toString('base64'); | ||
} | ||
}; |
@@ -0,1 +1,5 @@ | ||
0.1.29 / 2018-04-15 | ||
=================== | ||
- Fix: anonymizeProxy() now supports upstream proxies with empty password | ||
0.1.27 / 2018-03-27 | ||
@@ -2,0 +6,0 @@ =================== |
{ | ||
"name": "proxy-chain", | ||
"version": "0.1.28", | ||
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication and upstream proxy chaining.", | ||
"version": "0.1.29", | ||
"description": "Node.js implementation of a proxy server (think Squid) with support for SSL, authentication, upstream proxy chaining, and protocol tunneling.", | ||
"main": "build/index.js", | ||
@@ -9,3 +9,4 @@ "keywords": [ | ||
"squid", | ||
"apify" | ||
"apify", | ||
"tunnel" | ||
], | ||
@@ -12,0 +13,0 @@ "author": { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
105611
1682
10