Skip to content

Commit d369c77

Browse files
committed
1 parent 3b2951a commit d369c77

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

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

+13-3
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

+2-2
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -14282,13 +14282,13 @@
1428214282
}
1428314283
},
1428414284
"node_modules/socks-proxy-agent": {
14285-
"version": "8.0.4",
14286-
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz",
14287-
"integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==",
14285+
"version": "8.0.5",
14286+
"resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz",
14287+
"integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==",
1428814288
"inBundle": true,
1428914289
"license": "MIT",
1429014290
"dependencies": {
14291-
"agent-base": "^7.1.1",
14291+
"agent-base": "^7.1.2",
1429214292
"debug": "^4.3.4",
1429314293
"socks": "^2.8.3"
1429414294
},

0 commit comments

Comments
 (0)