Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

proxy-rotator-agent

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-rotator-agent

HTTP proxy rotator tunneling agent

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

proxy-rotator-agent

This agent rotates requests trought especified proxies

If 2 proxies are specified First request goes trought first proxy Second request goes trought seconde proxy Third request goes trought first proxy

for mikeal/request

const ProxyRotator = require('proxy-rotator-agent')

const agent = new ProxyRotator({
   proxies: [
     { host: 'proxy1.com', port: 3128, proxyAuth: 'pass', headers: { 'user-agent': 'nautilus' }},
     { host: 'proxy2.com', port: 4545, proxyAuth: 'proxy2pass', headers: { 'user-agent': 'firefox' }}
   ]
})

function optionalCallback(err, httpResponse, body) {
    console.log(err, body);
}

request({
  uri: 'https://ifconfig.net',
  json: true,
  agent,
  }, 
  optionalCallback
)

request({
  uri: 'https://ifconfig.net',
  json: true,
  agent,
  }, 
  optionalCallback
)
output: 
null {
      ip: '78.128.127.86',
      ip_decimal: 1317044054,
      country: 'Bulgaria',
      country_iso: 'BG',
      country_eu: true,
      latitude: 42.696,
      longitude: 23.332,
      time_zone: 'Europe/Sofia',
      asn: 'AS203380',
      asn_org: 'DA International Group Ltd.'
    }

null {
  ip: '154.6.90.11',
  ip_decimal: 2584107531,
  country: 'United States',
  country_iso: 'US',
  country_eu: false,
  region_name: 'New Mexico',
  region_code: 'NM',
  metro_code: 790,
  zip_code: '87198',
  city: 'Albuquerque',
  latitude: 35.0781,
  longitude: -106.6583,
  time_zone: 'America/Denver',
  asn: 'AS46562',
  asn_org: 'PERFORMIVE'
}

for axios

FAQs

Package last updated on 07 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc