Sha256: bf3ca389888fc59a0a6efadc2796c67d7b694937b3a9c4dd3069ec43acc88617
Contents?: true
Size: 528 Bytes
Versions: 26
Compression:
Stored size: 528 Bytes
Contents
"use strict"; const http = require("http"); const https = require("https"); const { HttpProxyAgent } = require("http-proxy-agent"); const { HttpsProxyAgent } = require("https-proxy-agent"); module.exports = function agentFactory(proxy, rejectUnauthorized) { const agentOpts = { keepAlive: true, rejectUnauthorized }; if (proxy) { return { https: new HttpsProxyAgent(proxy, agentOpts), http: new HttpProxyAgent(proxy, agentOpts) }; } return { http: new http.Agent(agentOpts), https: new https.Agent(agentOpts) }; };
Version data entries
26 entries across 26 versions & 1 rubygems