Skip to content

Commit 48c193a

Browse files
committed
1 parent 00fccfb commit 48c193a

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

node_modules/socks-proxy-agent/dist/index.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,21 @@ const socks_1 = require("socks");
3131
const agent_base_1 = require("agent-base");
3232
const debug_1 = __importDefault(require("debug"));
3333
const dns = __importStar(require("dns"));
34+
const net = __importStar(require("net"));
3435
const tls = __importStar(require("tls"));
3536
const url_1 = require("url");
3637
const debug = (0, debug_1.default)('socks-proxy-agent');
38+
const setServernameFromNonIpHost = (options) => {
39+
if (options.servername === undefined &&
40+
options.host &&
41+
!net.isIP(options.host)) {
42+
return {
43+
...options,
44+
servername: options.host,
45+
};
46+
}
47+
return options;
48+
};
3749
function parseSocksURL(url) {
3850
let lookup = false;
3951
let type = 5;
@@ -149,11 +161,9 @@ class SocksProxyAgent extends agent_base_1.Agent {
149161
// The proxy is connecting to a TLS server, so upgrade
150162
// this socket connection to a TLS connection.
151163
debug('Upgrading socket connection to TLS');
152-
const servername = opts.servername || opts.host;
153164
const tlsSocket = tls.connect({
154-
...omit(opts, 'host', 'path', 'port'),
165+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
155166
socket,
156-
servername,
157167
});
158168
tlsSocket.once('error', (error) => {
159169
debug('Socket TLS error', error.message);

node_modules/socks-proxy-agent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "socks-proxy-agent",
3-
"version": "8.0.4",
3+
"version": "8.0.5",
44
"description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -107,7 +107,7 @@
107107
"socks5h"
108108
],
109109
"dependencies": {
110-
"agent-base": "^7.1.1",
110+
"agent-base": "^7.1.2",
111111
"debug": "^4.3.4",
112112
"socks": "^2.8.3"
113113
},

package-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12950,13 +12950,13 @@
1295012950
}
1295112951
},
1295212952
"node_modules/socks-proxy-agent": {
12953-
"version": "8.0.4",
12954-
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz",
12955-
"integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==",
12953+
"version": "8.0.5",
12954+
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
12955+
"integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
1295612956
"inBundle": true,
1295712957
"license": "MIT",
1295812958
"dependencies": {
12959-
"agent-base": "^7.1.1",
12959+
"agent-base": "^7.1.2",
1296012960
"debug": "^4.3.4",
1296112961
"socks": "^2.8.3"
1296212962
},

0 commit comments

Comments
 (0)