socks-proxy-agent
Advanced tools
Comparing version 8.0.4 to 8.0.5
@@ -34,5 +34,17 @@ "use strict"; | ||
const dns = __importStar(require("dns")); | ||
const net = __importStar(require("net")); | ||
const tls = __importStar(require("tls")); | ||
const url_1 = require("url"); | ||
const debug = (0, debug_1.default)('socks-proxy-agent'); | ||
const setServernameFromNonIpHost = (options) => { | ||
if (options.servername === undefined && | ||
options.host && | ||
!net.isIP(options.host)) { | ||
return { | ||
...options, | ||
servername: options.host, | ||
}; | ||
} | ||
return options; | ||
}; | ||
function parseSocksURL(url) { | ||
@@ -153,7 +165,5 @@ let lookup = false; | ||
debug('Upgrading socket connection to TLS'); | ||
const servername = opts.servername || opts.host; | ||
const tlsSocket = tls.connect({ | ||
...omit(opts, 'host', 'path', 'port'), | ||
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'), | ||
socket, | ||
servername, | ||
}); | ||
@@ -160,0 +170,0 @@ tlsSocket.once('error', (error) => { |
@@ -34,5 +34,17 @@ "use strict"; | ||
const dns = __importStar(require("dns")); | ||
const net = __importStar(require("net")); | ||
const tls = __importStar(require("tls")); | ||
const url_1 = require("url"); | ||
const debug = (0, debug_1.default)('socks-proxy-agent'); | ||
const setServernameFromNonIpHost = (options) => { | ||
if (options.servername === undefined && | ||
options.host && | ||
!net.isIP(options.host)) { | ||
return { | ||
...options, | ||
servername: options.host, | ||
}; | ||
} | ||
return options; | ||
}; | ||
function parseSocksURL(url) { | ||
@@ -153,7 +165,5 @@ let lookup = false; | ||
debug('Upgrading socket connection to TLS'); | ||
const servername = opts.servername || opts.host; | ||
const tlsSocket = tls.connect({ | ||
...omit(opts, 'host', 'path', 'port'), | ||
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'), | ||
socket, | ||
servername, | ||
}); | ||
@@ -160,0 +170,0 @@ tlsSocket.once('error', (error) => { |
{ | ||
"name": "socks-proxy-agent", | ||
"version": "8.0.4", | ||
"version": "8.0.5", | ||
"description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS", | ||
@@ -110,3 +110,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"agent-base": "^7.1.1", | ||
"agent-base": "^7.1.2", | ||
"debug": "^4.3.4", | ||
@@ -113,0 +113,0 @@ "socks": "^2.8.3" |
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
Network access
Supply chain riskThis module accesses the network.
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
25533
414
6
Updatedagent-base@^7.1.2