http2-client
Advanced tools
Comparing version 1.2.6 to 1.3.0
@@ -310,3 +310,2 @@ | ||
client.close(); | ||
client.unref() | ||
} | ||
@@ -449,6 +448,13 @@ } | ||
identifyConnection(requestOptions , cb){ | ||
var sokcet = this.connect( requestOptions , function onConnect(){ | ||
cb(sokcet.alpnProtocol == 'h2' ? 'h2' : 'h1'); | ||
var socket = this.connect( requestOptions , function onConnect(){ | ||
if (socket.alpnProtocol == 'h2'){ | ||
cb('h2') | ||
} | ||
else{ | ||
//close http1.1 connection is it cannot be reused | ||
socket.end(); | ||
cb('h1') | ||
} | ||
}); | ||
return sokcet; | ||
return socket; | ||
} | ||
@@ -455,0 +461,0 @@ connect(authority, options, listener) { |
{ | ||
"name": "http2-client", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "Drop-in replacement for Nodes http and https that transparently make http request to both http1 / http2 server, it's using the ALPN protocol", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
53383
1166