proxy-rotator-agent
Advanced tools
Comparing version 0.0.7 to 0.0.8
20
index.js
@@ -24,17 +24,7 @@ 'use strict' | ||
const proxyOptions = self.proxies[self.index === self.maxIndex ? self.index = 0 : ++self.index] | ||
// console.log(proxyOptions) | ||
let tunnelAgentInstance = self.tunnelAgentsMap.get(proxyOptions) | ||
if (!tunnelAgentInstance) { | ||
// console.log(options) | ||
const reqProtocol = options.protocol || options.uri?.protocol || options._defaultAgent?.protocol; | ||
const uriProtocol = (reqProtocol === 'https:' ? 'https' : 'http') | ||
const proxyProtocol = (proxyOptions.proxy.protocol === 'https:' ? 'Https' : 'Http') | ||
const key = `${uriProtocol}Over${proxyProtocol}` | ||
// console.log(key, uriProtocol, proxyProtocol, proxyOptions) | ||
tunnelAgentInstance = tunnelAgent[key](proxyOptions); | ||
self.tunnelAgentsMap.set(proxyOptions, tunnelAgentInstance); | ||
} | ||
tunnelAgentInstance.on('free', (socket, host, port) => { | ||
self.emit('free', socket, host, port); | ||
}); | ||
const reqProtocol = options.protocol || options.uri?.protocol || options._defaultAgent?.protocol; | ||
const uriProtocol = (reqProtocol === 'https:' ? 'https' : 'http') | ||
const proxyProtocol = (proxyOptions.proxy.protocol === 'https:' ? 'Https' : 'Http') | ||
const key = `${uriProtocol}Over${proxyProtocol}` | ||
const tunnelAgentInstance = tunnelAgent[key](proxyOptions); | ||
tunnelAgentInstance.addRequest(req, options); | ||
@@ -41,0 +31,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"description": "HTTP proxy rotator tunneling agent", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "url": "https://github.com/fabiel-leon/proxy-rotator-agent" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
12802
34