We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04cb725 commit ed300a4Copy full SHA for ed300a4
index.js
@@ -41,8 +41,10 @@ function HttpsProxyAgent(opts) {
41
proxy.host = proxy.hostname || proxy.host;
42
proxy.port = +proxy.port || (this.secureProxy ? 443 : 80);
43
44
- if (this.secureProxy) {
45
- proxy.ALPNProtocols = proxy.ALPNProtocols || ['http 1.1']
+ // ALPN is supported by Node.js >= v5.
+ // attempt to negotiate http/1.1 for proxy servers that support http/2
46
+ if (this.secureProxy && !('ALPNProtocols' in proxy)) {
47
+ proxy.ALPNProtocols = ['http 1.1']
48
}
49
50
if (proxy.host && proxy.path) {
0 commit comments