rezo 1.0.60 → 1.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.cjs +6 -6
- package/dist/cache/index.cjs +9 -9
- package/dist/crawler/addon/oxylabs/index.cjs +1 -1
- package/dist/crawler/index.cjs +40 -40
- package/dist/crawler/plugin/index.cjs +1 -1
- package/dist/entries/crawler.cjs +4 -4
- package/dist/index.cjs +27 -27
- package/dist/internal/agents/index.cjs +10 -10
- package/dist/proxy/index.cjs +4 -4
- package/dist/queue/index.cjs +8 -8
- package/dist/responses/universal/index.cjs +11 -11
- package/dist/utils/agent-pool.cjs +10 -4
- package/dist/utils/agent-pool.js +10 -4
- package/package.json +1 -1
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.detectRuntime =
|
|
3
|
-
exports.getAdapterCapabilities =
|
|
4
|
-
exports.buildAdapterContext =
|
|
5
|
-
exports.getAvailableAdapters =
|
|
6
|
-
exports.selectAdapter =
|
|
1
|
+
const _mod_v4c5f2 = require('./picker.cjs');
|
|
2
|
+
exports.detectRuntime = _mod_v4c5f2.detectRuntime;
|
|
3
|
+
exports.getAdapterCapabilities = _mod_v4c5f2.getAdapterCapabilities;
|
|
4
|
+
exports.buildAdapterContext = _mod_v4c5f2.buildAdapterContext;
|
|
5
|
+
exports.getAvailableAdapters = _mod_v4c5f2.getAvailableAdapters;
|
|
6
|
+
exports.selectAdapter = _mod_v4c5f2.selectAdapter;;
|
package/dist/cache/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.LRUCache =
|
|
3
|
-
const
|
|
4
|
-
exports.DNSCache =
|
|
5
|
-
exports.getGlobalDNSCache =
|
|
6
|
-
exports.resetGlobalDNSCache =
|
|
7
|
-
const
|
|
8
|
-
exports.ResponseCache =
|
|
9
|
-
exports.normalizeResponseCacheConfig =
|
|
1
|
+
const _mod_29s8ea = require('./lru-cache.cjs');
|
|
2
|
+
exports.LRUCache = _mod_29s8ea.LRUCache;;
|
|
3
|
+
const _mod_hr6w8b = require('./dns-cache.cjs');
|
|
4
|
+
exports.DNSCache = _mod_hr6w8b.DNSCache;
|
|
5
|
+
exports.getGlobalDNSCache = _mod_hr6w8b.getGlobalDNSCache;
|
|
6
|
+
exports.resetGlobalDNSCache = _mod_hr6w8b.resetGlobalDNSCache;;
|
|
7
|
+
const _mod_6hfo4d = require('./response-cache.cjs');
|
|
8
|
+
exports.ResponseCache = _mod_6hfo4d.ResponseCache;
|
|
9
|
+
exports.normalizeResponseCacheConfig = _mod_6hfo4d.normalizeResponseCacheConfig;;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var{Rezo:
|
|
1
|
+
var{Rezo:p}=require("../../../core/rezo.cjs"),a=require("./options.cjs");exports.OXYLABS_BROWSER_TYPES=a.OXYLABS_BROWSER_TYPES;exports.OXYLABS_COMMON_LOCALES=a.OXYLABS_COMMON_LOCALES;exports.OXYLABS_COMMON_GEO_LOCATIONS=a.OXYLABS_COMMON_GEO_LOCATIONS;exports.OXYLABS_US_STATES=a.OXYLABS_US_STATES;exports.OXYLABS_EUROPEAN_COUNTRIES=a.OXYLABS_EUROPEAN_COUNTRIES;exports.OXYLABS_ASIAN_COUNTRIES=a.OXYLABS_ASIAN_COUNTRIES;exports.getRandomBrowserType=a.getRandomBrowserType;exports.getRandomLocale=a.getRandomLocale;exports.getRandomGeoLocation=a.getRandomGeoLocation;var c="https://realtime.oxylabs.io/v1/queries";class u{config;http;authHeader;constructor(e){if(!e.username||!e.password)throw Error("Oxylabs username and password are required");this.config={username:e.username,password:e.password,browserType:e.browserType??"desktop",locale:e.locale??"en-US",geoLocation:e.geoLocation??"",render:e.render??!1,context:e.context??{},timeout:e.timeout??120000},this.http=new p({baseURL:c,timeout:this.config.timeout}),this.authHeader=`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}async scrape(e,t){let r={...this.config,...t},s=this.buildRequestBody(e,r),o=(await this.http.postJson(c,s,{headers:{Authorization:this.authHeader,"Content-Type":"application/json"}})).data;if(o.error)throw Error(`Oxylabs API error: ${o.error}`);if(!o.results||o.results.length===0)throw Error("Oxylabs API returned no results");let n=o.results[0],d=n._response?.cookies||[],l=n._response?.headers||{};return{statusCode:n.status_code,url:n.url,content:n.content,cookies:d,headers:l,jobId:o.job_id||n.job_id,rendered:r.render,geoLocation:r.geoLocation||void 0,locale:r.locale,browserType:r.browserType,raw:o}}async scrapeMany(e,t,r=1000){let s=[];for(let i=0;i<e.length;i++){let o=await this.scrape(e[i],t);if(s.push(o),i<e.length-1&&r>0)await new Promise((n)=>setTimeout(n,r))}return s}buildRequestBody(e,t){let r=[];if(r.push({key:"return_page_cookies",value:!0}),r.push({key:"return_page_headers",value:!0}),t.context)for(let[i,o]of Object.entries(t.context))r.push({key:i,value:o});let s={source:"universal",url:e,context:r};if(t.render)s.render="html";if(t.browserType)s.user_agent_type=t.browserType;if(t.locale)s.locale=t.locale;if(t.geoLocation)s.geo_location=t.geoLocation;return s}getConfig(){return{...this.config,password:"***"}}withConfig(e){return new u({...this.config,...e})}async testConnection(){try{return await this.scrape("https://httpbin.org/ip"),!0}catch(e){throw Error(`Oxylabs connection test failed: ${e.message}`)}}}exports.Oxylabs=u;exports.default=u;module.exports=Object.assign(u,exports);
|
package/dist/crawler/index.cjs
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Crawler =
|
|
3
|
-
const
|
|
4
|
-
exports.CrawlerOptions =
|
|
5
|
-
const
|
|
6
|
-
exports.RobotsTxt =
|
|
7
|
-
const
|
|
8
|
-
exports.FileCacher =
|
|
9
|
-
const
|
|
10
|
-
exports.UrlStore =
|
|
11
|
-
const
|
|
12
|
-
exports.NavigationHistory =
|
|
13
|
-
const
|
|
14
|
-
exports.Oxylabs =
|
|
15
|
-
const
|
|
16
|
-
exports.OXYLABS_BROWSER_TYPES =
|
|
17
|
-
exports.OXYLABS_COMMON_LOCALES =
|
|
18
|
-
exports.OXYLABS_COMMON_GEO_LOCATIONS =
|
|
19
|
-
exports.OXYLABS_US_STATES =
|
|
20
|
-
exports.OXYLABS_EUROPEAN_COUNTRIES =
|
|
21
|
-
exports.OXYLABS_ASIAN_COUNTRIES =
|
|
22
|
-
exports.getRandomOxylabsBrowserType =
|
|
23
|
-
exports.getRandomOxylabsLocale =
|
|
24
|
-
exports.getRandomOxylabsGeoLocation =
|
|
25
|
-
const
|
|
26
|
-
exports.Decodo =
|
|
27
|
-
const
|
|
28
|
-
exports.DECODO_DEVICE_TYPES =
|
|
29
|
-
exports.DECODO_HEADLESS_MODES =
|
|
30
|
-
exports.DECODO_COMMON_LOCALES =
|
|
31
|
-
exports.DECODO_COMMON_COUNTRIES =
|
|
32
|
-
exports.DECODO_EUROPEAN_COUNTRIES =
|
|
33
|
-
exports.DECODO_ASIAN_COUNTRIES =
|
|
34
|
-
exports.DECODO_US_STATES =
|
|
35
|
-
exports.DECODO_COMMON_CITIES =
|
|
36
|
-
exports.getRandomDecodoDeviceType =
|
|
37
|
-
exports.getRandomDecodoLocale =
|
|
38
|
-
exports.getRandomDecodoCountry =
|
|
39
|
-
exports.getRandomDecodoCity =
|
|
40
|
-
exports.generateDecodoSessionId =
|
|
1
|
+
const _mod_pjsv6m = require('./crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_pjsv6m.Crawler;;
|
|
3
|
+
const _mod_ja9di8 = require('./crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_ja9di8.CrawlerOptions;;
|
|
5
|
+
const _mod_avcga9 = require('./plugin/robots-txt.cjs');
|
|
6
|
+
exports.RobotsTxt = _mod_avcga9.RobotsTxt;;
|
|
7
|
+
const _mod_ym5hqf = require('./plugin/file-cacher.cjs');
|
|
8
|
+
exports.FileCacher = _mod_ym5hqf.FileCacher;;
|
|
9
|
+
const _mod_x5kf2s = require('./plugin/url-store.cjs');
|
|
10
|
+
exports.UrlStore = _mod_x5kf2s.UrlStore;;
|
|
11
|
+
const _mod_zkw2yc = require('./plugin/navigation-history.cjs');
|
|
12
|
+
exports.NavigationHistory = _mod_zkw2yc.NavigationHistory;;
|
|
13
|
+
const _mod_a34qc5 = require('./addon/oxylabs/index.cjs');
|
|
14
|
+
exports.Oxylabs = _mod_a34qc5.Oxylabs;;
|
|
15
|
+
const _mod_zpgll1 = require('./addon/oxylabs/options.cjs');
|
|
16
|
+
exports.OXYLABS_BROWSER_TYPES = _mod_zpgll1.OXYLABS_BROWSER_TYPES;
|
|
17
|
+
exports.OXYLABS_COMMON_LOCALES = _mod_zpgll1.OXYLABS_COMMON_LOCALES;
|
|
18
|
+
exports.OXYLABS_COMMON_GEO_LOCATIONS = _mod_zpgll1.OXYLABS_COMMON_GEO_LOCATIONS;
|
|
19
|
+
exports.OXYLABS_US_STATES = _mod_zpgll1.OXYLABS_US_STATES;
|
|
20
|
+
exports.OXYLABS_EUROPEAN_COUNTRIES = _mod_zpgll1.OXYLABS_EUROPEAN_COUNTRIES;
|
|
21
|
+
exports.OXYLABS_ASIAN_COUNTRIES = _mod_zpgll1.OXYLABS_ASIAN_COUNTRIES;
|
|
22
|
+
exports.getRandomOxylabsBrowserType = _mod_zpgll1.getRandomBrowserType;
|
|
23
|
+
exports.getRandomOxylabsLocale = _mod_zpgll1.getRandomLocale;
|
|
24
|
+
exports.getRandomOxylabsGeoLocation = _mod_zpgll1.getRandomGeoLocation;;
|
|
25
|
+
const _mod_w5hd29 = require('./addon/decodo/index.cjs');
|
|
26
|
+
exports.Decodo = _mod_w5hd29.Decodo;;
|
|
27
|
+
const _mod_jejdkn = require('./addon/decodo/options.cjs');
|
|
28
|
+
exports.DECODO_DEVICE_TYPES = _mod_jejdkn.DECODO_DEVICE_TYPES;
|
|
29
|
+
exports.DECODO_HEADLESS_MODES = _mod_jejdkn.DECODO_HEADLESS_MODES;
|
|
30
|
+
exports.DECODO_COMMON_LOCALES = _mod_jejdkn.DECODO_COMMON_LOCALES;
|
|
31
|
+
exports.DECODO_COMMON_COUNTRIES = _mod_jejdkn.DECODO_COMMON_COUNTRIES;
|
|
32
|
+
exports.DECODO_EUROPEAN_COUNTRIES = _mod_jejdkn.DECODO_EUROPEAN_COUNTRIES;
|
|
33
|
+
exports.DECODO_ASIAN_COUNTRIES = _mod_jejdkn.DECODO_ASIAN_COUNTRIES;
|
|
34
|
+
exports.DECODO_US_STATES = _mod_jejdkn.DECODO_US_STATES;
|
|
35
|
+
exports.DECODO_COMMON_CITIES = _mod_jejdkn.DECODO_COMMON_CITIES;
|
|
36
|
+
exports.getRandomDecodoDeviceType = _mod_jejdkn.getRandomDeviceType;
|
|
37
|
+
exports.getRandomDecodoLocale = _mod_jejdkn.getRandomLocale;
|
|
38
|
+
exports.getRandomDecodoCountry = _mod_jejdkn.getRandomCountry;
|
|
39
|
+
exports.getRandomDecodoCity = _mod_jejdkn.getRandomCity;
|
|
40
|
+
exports.generateDecodoSessionId = _mod_jejdkn.generateSessionId;;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r=require("./file-cacher.cjs");exports.FileCacher=r.FileCacher;var e=require("./url-store.cjs");exports.UrlStore=e.UrlStore;
|
package/dist/entries/crawler.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Crawler =
|
|
3
|
-
const
|
|
4
|
-
exports.CrawlerOptions =
|
|
1
|
+
const _mod_3rm3qp = require('../crawler/crawler.cjs');
|
|
2
|
+
exports.Crawler = _mod_3rm3qp.Crawler;;
|
|
3
|
+
const _mod_ovn9ep = require('../crawler/crawler-options.cjs');
|
|
4
|
+
exports.CrawlerOptions = _mod_ovn9ep.CrawlerOptions;;
|
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Rezo =
|
|
3
|
-
exports.createRezoInstance =
|
|
4
|
-
exports.createDefaultInstance =
|
|
5
|
-
const
|
|
6
|
-
exports.RezoError =
|
|
7
|
-
exports.RezoErrorCode =
|
|
8
|
-
const
|
|
9
|
-
exports.RezoHeaders =
|
|
10
|
-
const
|
|
11
|
-
exports.RezoFormData =
|
|
12
|
-
const
|
|
13
|
-
exports.RezoCookieJar =
|
|
14
|
-
exports.Cookie =
|
|
15
|
-
const
|
|
16
|
-
exports.toCurl =
|
|
17
|
-
exports.fromCurl =
|
|
18
|
-
const
|
|
19
|
-
exports.createDefaultHooks =
|
|
20
|
-
exports.mergeHooks =
|
|
21
|
-
const
|
|
22
|
-
exports.ProxyManager =
|
|
23
|
-
const
|
|
24
|
-
exports.RezoQueue =
|
|
25
|
-
exports.HttpQueue =
|
|
26
|
-
exports.Priority =
|
|
27
|
-
exports.HttpMethodPriority =
|
|
1
|
+
const _mod_k1xi2g = require('./core/rezo.cjs');
|
|
2
|
+
exports.Rezo = _mod_k1xi2g.Rezo;
|
|
3
|
+
exports.createRezoInstance = _mod_k1xi2g.createRezoInstance;
|
|
4
|
+
exports.createDefaultInstance = _mod_k1xi2g.createDefaultInstance;;
|
|
5
|
+
const _mod_43iwre = require('./errors/rezo-error.cjs');
|
|
6
|
+
exports.RezoError = _mod_43iwre.RezoError;
|
|
7
|
+
exports.RezoErrorCode = _mod_43iwre.RezoErrorCode;;
|
|
8
|
+
const _mod_j7hcxw = require('./utils/headers.cjs');
|
|
9
|
+
exports.RezoHeaders = _mod_j7hcxw.RezoHeaders;;
|
|
10
|
+
const _mod_d6a9p7 = require('./utils/form-data.cjs');
|
|
11
|
+
exports.RezoFormData = _mod_d6a9p7.RezoFormData;;
|
|
12
|
+
const _mod_z9egfa = require('./utils/cookies.cjs');
|
|
13
|
+
exports.RezoCookieJar = _mod_z9egfa.RezoCookieJar;
|
|
14
|
+
exports.Cookie = _mod_z9egfa.Cookie;;
|
|
15
|
+
const _mod_oadyq4 = require('./utils/curl.cjs');
|
|
16
|
+
exports.toCurl = _mod_oadyq4.toCurl;
|
|
17
|
+
exports.fromCurl = _mod_oadyq4.fromCurl;;
|
|
18
|
+
const _mod_7hadvr = require('./core/hooks.cjs');
|
|
19
|
+
exports.createDefaultHooks = _mod_7hadvr.createDefaultHooks;
|
|
20
|
+
exports.mergeHooks = _mod_7hadvr.mergeHooks;;
|
|
21
|
+
const _mod_hxjsb2 = require('./proxy/manager.cjs');
|
|
22
|
+
exports.ProxyManager = _mod_hxjsb2.ProxyManager;;
|
|
23
|
+
const _mod_171fz2 = require('./queue/index.cjs');
|
|
24
|
+
exports.RezoQueue = _mod_171fz2.RezoQueue;
|
|
25
|
+
exports.HttpQueue = _mod_171fz2.HttpQueue;
|
|
26
|
+
exports.Priority = _mod_171fz2.Priority;
|
|
27
|
+
exports.HttpMethodPriority = _mod_171fz2.HttpMethodPriority;;
|
|
28
28
|
const { RezoError } = require('./errors/rezo-error.cjs');
|
|
29
29
|
const isRezoError = exports.isRezoError = RezoError.isRezoError;
|
|
30
30
|
const Cancel = exports.Cancel = RezoError;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.Agent =
|
|
3
|
-
const
|
|
4
|
-
exports.HttpProxyAgent =
|
|
5
|
-
const
|
|
6
|
-
exports.HttpsProxyAgent =
|
|
7
|
-
const
|
|
8
|
-
exports.SocksProxyAgent =
|
|
9
|
-
const
|
|
10
|
-
exports.SocksClient =
|
|
1
|
+
const _mod_aby660 = require('./base.cjs');
|
|
2
|
+
exports.Agent = _mod_aby660.Agent;;
|
|
3
|
+
const _mod_o53zfo = require('./http-proxy.cjs');
|
|
4
|
+
exports.HttpProxyAgent = _mod_o53zfo.HttpProxyAgent;;
|
|
5
|
+
const _mod_htrjvx = require('./https-proxy.cjs');
|
|
6
|
+
exports.HttpsProxyAgent = _mod_htrjvx.HttpsProxyAgent;;
|
|
7
|
+
const _mod_juar6t = require('./socks-proxy.cjs');
|
|
8
|
+
exports.SocksProxyAgent = _mod_juar6t.SocksProxyAgent;;
|
|
9
|
+
const _mod_1ypehb = require('./socks-client.cjs');
|
|
10
|
+
exports.SocksClient = _mod_1ypehb.SocksClient;;
|
package/dist/proxy/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const { Agent, HttpProxyAgent, HttpsProxyAgent, SocksProxyAgent } = require('../internal/agents/index.cjs');
|
|
2
2
|
const { parseProxyString } = require('./parse.cjs');
|
|
3
|
-
const
|
|
4
|
-
exports.ProxyManager =
|
|
5
|
-
const
|
|
6
|
-
exports.parseProxyString =
|
|
3
|
+
const _mod_87mv8a = require('./manager.cjs');
|
|
4
|
+
exports.ProxyManager = _mod_87mv8a.ProxyManager;;
|
|
5
|
+
const _mod_n37alc = require('./parse.cjs');
|
|
6
|
+
exports.parseProxyString = _mod_n37alc.parseProxyString;;
|
|
7
7
|
function createOptions(uri, opts) {
|
|
8
8
|
if (uri instanceof URL || typeof uri === "string") {
|
|
9
9
|
return {
|
package/dist/queue/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.RezoQueue =
|
|
3
|
-
const
|
|
4
|
-
exports.HttpQueue =
|
|
5
|
-
exports.extractDomain =
|
|
6
|
-
const
|
|
7
|
-
exports.Priority =
|
|
8
|
-
exports.HttpMethodPriority =
|
|
1
|
+
const _mod_x2pd1l = require('./queue.cjs');
|
|
2
|
+
exports.RezoQueue = _mod_x2pd1l.RezoQueue;;
|
|
3
|
+
const _mod_nx6gpl = require('./http-queue.cjs');
|
|
4
|
+
exports.HttpQueue = _mod_nx6gpl.HttpQueue;
|
|
5
|
+
exports.extractDomain = _mod_nx6gpl.extractDomain;;
|
|
6
|
+
const _mod_q2nk0x = require('./types.cjs');
|
|
7
|
+
exports.Priority = _mod_q2nk0x.Priority;
|
|
8
|
+
exports.HttpMethodPriority = _mod_q2nk0x.HttpMethodPriority;;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
exports.UniversalEventEmitter =
|
|
3
|
-
const
|
|
4
|
-
exports.UniversalStreamResponse =
|
|
5
|
-
exports.StreamResponse =
|
|
6
|
-
const
|
|
7
|
-
exports.UniversalDownloadResponse =
|
|
8
|
-
exports.DownloadResponse =
|
|
9
|
-
const
|
|
10
|
-
exports.UniversalUploadResponse =
|
|
11
|
-
exports.UploadResponse =
|
|
1
|
+
const _mod_c58fz1 = require('./event-emitter.cjs');
|
|
2
|
+
exports.UniversalEventEmitter = _mod_c58fz1.UniversalEventEmitter;;
|
|
3
|
+
const _mod_sj41p1 = require('./stream.cjs');
|
|
4
|
+
exports.UniversalStreamResponse = _mod_sj41p1.UniversalStreamResponse;
|
|
5
|
+
exports.StreamResponse = _mod_sj41p1.StreamResponse;;
|
|
6
|
+
const _mod_rdo4xg = require('./download.cjs');
|
|
7
|
+
exports.UniversalDownloadResponse = _mod_rdo4xg.UniversalDownloadResponse;
|
|
8
|
+
exports.DownloadResponse = _mod_rdo4xg.DownloadResponse;;
|
|
9
|
+
const _mod_uwzrn9 = require('./upload.cjs');
|
|
10
|
+
exports.UniversalUploadResponse = _mod_uwzrn9.UniversalUploadResponse;
|
|
11
|
+
exports.UploadResponse = _mod_uwzrn9.UploadResponse;;
|
|
@@ -70,7 +70,11 @@ class AgentPool {
|
|
|
70
70
|
agentOptions.lookup = lookup;
|
|
71
71
|
}
|
|
72
72
|
const agent = new http.Agent(agentOptions);
|
|
73
|
-
|
|
73
|
+
agent.on("free", (socket) => {
|
|
74
|
+
if (socket && typeof socket.unref === "function") {
|
|
75
|
+
socket.unref();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
74
78
|
return agent;
|
|
75
79
|
}
|
|
76
80
|
setupAgentSocketUnref(agent) {
|
|
@@ -95,7 +99,11 @@ class AgentPool {
|
|
|
95
99
|
agentOptions.lookup = lookup;
|
|
96
100
|
}
|
|
97
101
|
const agent = new https.Agent(agentOptions);
|
|
98
|
-
|
|
102
|
+
agent.on("free", (socket) => {
|
|
103
|
+
if (socket && typeof socket.unref === "function") {
|
|
104
|
+
socket.unref();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
99
107
|
return agent;
|
|
100
108
|
}
|
|
101
109
|
getHttpAgent(options) {
|
|
@@ -163,12 +171,10 @@ class AgentPool {
|
|
|
163
171
|
this.evictionTimer = null;
|
|
164
172
|
}
|
|
165
173
|
for (const pooled of this.httpAgents.values()) {
|
|
166
|
-
this.destroyAgentSockets(pooled.agent);
|
|
167
174
|
pooled.agent.destroy();
|
|
168
175
|
}
|
|
169
176
|
this.httpAgents.clear();
|
|
170
177
|
for (const pooled of this.httpsAgents.values()) {
|
|
171
|
-
this.destroyAgentSockets(pooled.agent);
|
|
172
178
|
pooled.agent.destroy();
|
|
173
179
|
}
|
|
174
180
|
this.httpsAgents.clear();
|
package/dist/utils/agent-pool.js
CHANGED
|
@@ -70,7 +70,11 @@ class AgentPool {
|
|
|
70
70
|
agentOptions.lookup = lookup;
|
|
71
71
|
}
|
|
72
72
|
const agent = new http.Agent(agentOptions);
|
|
73
|
-
|
|
73
|
+
agent.on("free", (socket) => {
|
|
74
|
+
if (socket && typeof socket.unref === "function") {
|
|
75
|
+
socket.unref();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
74
78
|
return agent;
|
|
75
79
|
}
|
|
76
80
|
setupAgentSocketUnref(agent) {
|
|
@@ -95,7 +99,11 @@ class AgentPool {
|
|
|
95
99
|
agentOptions.lookup = lookup;
|
|
96
100
|
}
|
|
97
101
|
const agent = new https.Agent(agentOptions);
|
|
98
|
-
|
|
102
|
+
agent.on("free", (socket) => {
|
|
103
|
+
if (socket && typeof socket.unref === "function") {
|
|
104
|
+
socket.unref();
|
|
105
|
+
}
|
|
106
|
+
});
|
|
99
107
|
return agent;
|
|
100
108
|
}
|
|
101
109
|
getHttpAgent(options) {
|
|
@@ -163,12 +171,10 @@ class AgentPool {
|
|
|
163
171
|
this.evictionTimer = null;
|
|
164
172
|
}
|
|
165
173
|
for (const pooled of this.httpAgents.values()) {
|
|
166
|
-
this.destroyAgentSockets(pooled.agent);
|
|
167
174
|
pooled.agent.destroy();
|
|
168
175
|
}
|
|
169
176
|
this.httpAgents.clear();
|
|
170
177
|
for (const pooled of this.httpsAgents.values()) {
|
|
171
|
-
this.destroyAgentSockets(pooled.agent);
|
|
172
178
|
pooled.agent.destroy();
|
|
173
179
|
}
|
|
174
180
|
this.httpsAgents.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rezo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.61",
|
|
4
4
|
"description": "Lightning-fast, enterprise-grade HTTP client for modern JavaScript. Full HTTP/2 support, intelligent cookie management, multiple adapters (HTTP, Fetch, cURL, XHR), streaming, proxy support (HTTP/HTTPS/SOCKS), and cross-environment compatibility.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|