session destroy fixed

This commit is contained in:
C
2022-12-29 16:16:19 +05:00
parent 61b35128f4
commit b11e2536cb
13 changed files with 146 additions and 64 deletions
+15
View File
@@ -1,4 +1,5 @@
const http = require('http')
const https = require('https')
module.exports = class http_client {
constructor(ip, port) {
@@ -63,4 +64,18 @@ module.exports.get = async (options, callback_res, callback_err) => {
}).on('error', err => {
callback_err(err)
})
}
module.exports.gets = async (options, callback_res, callback_err) => {
https.get(options, function(res) {
var body_chunks = []
res.on('data', chunk => {
body_chunks.push(chunk)
}).on('end', () => {
var body = Buffer.concat(body_chunks)
callback_res(body)
})
}).on('error', err => {
callback_err(err)
})
}