http2-wrapper
Advanced tools
Comparing version 1.0.0-beta.0 to 1.0.0-beta.1
{ | ||
"name": "http2-wrapper", | ||
"version": "1.0.0-beta.0", | ||
"version": "1.0.0-beta.1", | ||
"description": "HTTP2 client, just with the familiar `https` API", | ||
@@ -43,3 +43,3 @@ "main": "source", | ||
"get-stream": "^5.1.0", | ||
"got": "^9.6.0", | ||
"got": "^10.0.0-alpha.3", | ||
"lolex": "^4.2.0", | ||
@@ -46,0 +46,0 @@ "many-keys-map": "^1.0.2", |
'use strict'; | ||
const EventEmitter = require('events'); | ||
const tls = require('tls'); | ||
@@ -120,4 +121,6 @@ const http2 = require('http2'); | ||
class Agent { | ||
class Agent extends EventEmitter { | ||
constructor({timeout = 60000, maxSessions = Infinity, maxFreeSessions = 1, maxCachedTlsSessions = 100} = {}) { | ||
super(); | ||
// A session is considered busy when its current streams count | ||
@@ -434,2 +437,4 @@ // is equal to or greater than the `maxConcurrentStreams` value. | ||
this.emit('session', session); | ||
if (freeSession()) { | ||
@@ -436,0 +441,0 @@ // Process listeners, we're free. |
@@ -224,3 +224,3 @@ 'use strict'; | ||
this._request.once('response', (headers, flags, rawHeaders) => { | ||
this.res = new IncomingMessage(this.socket); | ||
this.res = new IncomingMessage(this.connection); | ||
this.res.req = this; | ||
@@ -275,3 +275,3 @@ this.res.statusCode = headers[HTTP2_HEADER_STATUS]; | ||
process.nextTick(() => { | ||
this.emit('socket', this._request.session.socket); | ||
this.emit('socket', this.connection); | ||
}); | ||
@@ -278,0 +278,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
46452
1023