Comparing version 4.0.5 to 4.1.0-beta
27
hiio.js
@@ -350,11 +350,16 @@ 'use strict'; | ||
this.keepalive = options.keepalive | ||
this.reconnDelay = options.reconnDelay | ||
this.connected = false | ||
this.init() | ||
} | ||
init() { | ||
init () { | ||
this.session.on('connect', () => { | ||
this.connected = true | ||
}) | ||
this.session.on('close', () => { | ||
this.connected = false | ||
if (this.keepalive && typeof this.reconn === 'function') { | ||
if (this.debug) { | ||
console.log('Connect close, reconnect...') | ||
} | ||
this.debug && console.log('Connect closed, reconnect...') | ||
this.reconn() | ||
@@ -367,5 +372,4 @@ } else { | ||
this.session.on('error', err => { | ||
if (this.debug) { | ||
console.error(err) | ||
} | ||
this.debug && console.error(err) | ||
this.connected = false | ||
this.session.destroy() | ||
@@ -715,2 +719,3 @@ }) | ||
req.host = '' | ||
req.connected = false | ||
this.pool.push(req) | ||
@@ -724,2 +729,3 @@ } | ||
if (r) { | ||
r.connected = true | ||
r.session = options.session | ||
@@ -792,2 +798,3 @@ r.host = options.host | ||
keepalive : options.keepalive === undefined ? false : true, | ||
reconnDelay : options.reconnDelay === undefined ? 100 : options.reconnDelay | ||
}) | ||
@@ -798,4 +805,6 @@ | ||
options.sessionRequest = newReq | ||
this.connect(url, options) | ||
newReq.init() | ||
setTimeout(() => { | ||
this.connect(url, options) | ||
newReq.init() | ||
}, newReq.reconnDelay) | ||
} | ||
@@ -802,0 +811,0 @@ } |
{ | ||
"name": "gohttp", | ||
"version": "4.0.5", | ||
"version": "4.1.0-beta", | ||
"description": "http & https client for HTTP/1.1 and HTTP/2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
82439
19
1859
3
2