+19
-9
lines changedFilter options
+19
-9
lines changed Original file line number Diff line number Diff line change
@@ -31,9 +31,21 @@ const socks_1 = require("socks");
31
31
const agent_base_1 = require("agent-base");
32
32
const debug_1 = __importDefault(require("debug"));
33
33
const dns = __importStar(require("dns"));
34
+
const net = __importStar(require("net"));
34
35
const tls = __importStar(require("tls"));
35
36
const url_1 = require("url");
36
37
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
+
};
37
49
function parseSocksURL(url) {
38
50
let lookup = false;
39
51
let type = 5;
@@ -149,11 +161,9 @@ class SocksProxyAgent extends agent_base_1.Agent {
149
161
// The proxy is connecting to a TLS server, so upgrade
150
162
// this socket connection to a TLS connection.
151
163
debug('Upgrading socket connection to TLS');
152
-
const servername = opts.servername || opts.host;
153
164
const tlsSocket = tls.connect({
154
-
...omit(opts, 'host', 'path', 'port'),
165
+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
155
166
socket,
156
-
servername,
157
167
});
158
168
tlsSocket.once('error', (error) => {
159
169
debug('Socket TLS error', error.message);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "socks-proxy-agent",
3
-
"version": "8.0.4",
3
+
"version": "8.0.5",
4
4
"description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS",
5
5
"main": "./dist/index.js",
6
6
"types": "./dist/index.d.ts",
@@ -107,7 +107,7 @@
107
107
"socks5h"
108
108
],
109
109
"dependencies": {
110
-
"agent-base": "^7.1.1",
110
+
"agent-base": "^7.1.2",
111
111
"debug": "^4.3.4",
112
112
"socks": "^2.8.3"
113
113
},
Original file line number Diff line number Diff line change
@@ -12950,13 +12950,13 @@
12950
12950
}
12951
12951
},
12952
12952
"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==",
12956
12956
"inBundle": true,
12957
12957
"license": "MIT",
12958
12958
"dependencies": {
12959
-
"agent-base": "^7.1.1",
12959
+
"agent-base": "^7.1.2",
12960
12960
"debug": "^4.3.4",
12961
12961
"socks": "^2.8.3"
12962
12962
},
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4