New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gohttp

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gohttp - npm Package Compare versions

Comparing version

to
4.1.0-beta3

24

hiio.js

@@ -360,5 +360,11 @@ 'use strict';

this.session.on('close', () => {
this.session.on('close', async () => {
this.connected = false
if (this.keepalive && typeof this.reconn === 'function') {
await new Promise((rv, rj) => {
setTimeout(() => {
rv()
}, this.reconnDelay)
})
this.debug && console.log('Connect closed, reconnect...')

@@ -681,2 +687,8 @@ this.reconn()

on (evt, callback) {
for (let a of this.pool) {
a.on(evt, callback)
}
}
}

@@ -799,9 +811,11 @@

/**
* 延迟重连不能使用setTimeout,因为timer循环会在下一个循环开始执行,
* 而在本次循环,error的处理会先执行,此时,error事件还没有监听。
*/
if (options.keepalive) {
newReq.reconn = () => {
options.sessionRequest = newReq
setTimeout(() => {
this.connect(url, options)
newReq.init()
}, newReq.reconnDelay)
this.connect(url, options)
newReq.init()
}

@@ -808,0 +822,0 @@ }

{
"name": "gohttp",
"version": "4.1.0-beta2",
"version": "4.1.0-beta3",
"description": "http & https client for HTTP/1.1 and HTTP/2",

@@ -5,0 +5,0 @@ "main": "index.js",