http2-wrapper
Advanced tools
Comparing version 1.0.0-beta.4.5 to 1.0.0-beta.4.6
{ | ||
"name": "http2-wrapper", | ||
"version": "1.0.0-beta.4.5", | ||
"version": "1.0.0-beta.4.6", | ||
"description": "HTTP2 client, just with the familiar `https` API", | ||
@@ -5,0 +5,0 @@ "main": "source", |
@@ -49,3 +49,3 @@ 'use strict'; | ||
const {path} = options; | ||
const {path, agent} = options; | ||
options.path = options.socketPath; | ||
@@ -63,13 +63,18 @@ | ||
if (alpnProtocol === 'h2') { | ||
// TODO: Reuse socket | ||
socket.end(); | ||
// https://github.com/nodejs/node/issues/33343 | ||
socket.destroy(); | ||
} else { | ||
const agent = options.agent || https.globalAgent; | ||
const {globalAgent} = https; | ||
const defaultCreateConnection = https.Agent.prototype.createConnection; | ||
if (options.createConnection) { | ||
socket.end(); | ||
} else if (agent.keepAlive) { | ||
installSocket(agent, socket, options); | ||
if (agent) { | ||
if (agent.createConnection === defaultCreateConnection) { | ||
installSocket(agent, socket, options); | ||
} else { | ||
socket.destroy(); | ||
} | ||
} else if (globalAgent.createConnection === defaultCreateConnection) { | ||
installSocket(globalAgent, socket, options); | ||
} else { | ||
options.createConnection = () => socket; | ||
socket.destroy(); | ||
} | ||
@@ -76,0 +81,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48325
1110