+19
-14
lines changedFilter options
+19
-14
lines changed Original file line number Diff line number Diff line change
@@ -35,6 +35,17 @@ const agent_base_1 = require("agent-base");
35
35
const url_1 = require("url");
36
36
const parse_proxy_response_1 = require("./parse-proxy-response");
37
37
const debug = (0, debug_1.default)('https-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
+
};
38
49
/**
39
50
* The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
40
51
* the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
@@ -82,11 +93,7 @@ class HttpsProxyAgent extends agent_base_1.Agent {
82
93
let socket;
83
94
if (proxy.protocol === 'https:') {
84
95
debug('Creating `tls.Socket`: %o', this.connectOpts);
85
-
const servername = this.connectOpts.servername || this.connectOpts.host;
86
-
socket = tls.connect({
87
-
...this.connectOpts,
88
-
servername,
89
-
});
96
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
90
97
}
91
98
else {
92
99
debug('Creating `net.Socket`: %o', this.connectOpts);
@@ -122,11 +129,9 @@ class HttpsProxyAgent extends agent_base_1.Agent {
122
129
// The proxy is connecting to a TLS server, so upgrade
123
130
// this socket connection to a TLS connection.
124
131
debug('Upgrading socket connection to TLS');
125
-
const servername = opts.servername || opts.host;
126
132
return tls.connect({
127
-
...omit(opts, 'host', 'path', 'port'),
133
+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
128
134
socket,
129
-
servername,
130
135
});
131
136
}
132
137
return socket;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "https-proxy-agent",
3
-
"version": "7.0.5",
3
+
"version": "7.0.6",
4
4
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
5
5
"main": "./dist/index.js",
6
6
"types": "./dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
22
22
"license": "MIT",
23
23
"dependencies": {
24
-
"agent-base": "^7.0.2",
24
+
"agent-base": "^7.1.2",
25
25
"debug": "4"
26
26
},
27
27
"devDependencies": {
Original file line number Diff line number Diff line change
@@ -9095,13 +9095,13 @@
9095
9095
}
9096
9096
},
9097
9097
"node_modules/https-proxy-agent": {
9098
-
"version": "7.0.5",
9099
-
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
9100
-
"integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
9098
+
"version": "7.0.6",
9099
+
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
9100
+
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
9101
9101
"inBundle": true,
9102
9102
"license": "MIT",
9103
9103
"dependencies": {
9104
-
"agent-base": "^7.0.2",
9104
+
"agent-base": "^7.1.2",
9105
9105
"debug": "4"
9106
9106
},
9107
9107
"engines": {
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