npm

Need private packages and team management tools?Check out npm Orgs. »

gimmeproxy-request

1.0.12 • Public • Published

gimmeproxy-request [beta]

Make request through random proxy using https://gimmeproxy.com service.

This library automatically collects proxies from GimmeProxy in the background. Each request is routed through random proxy and retried automatically if needed.

This is wrapper around request library, any request options should work just fine.

Allows you to pass custom GimmeProxy api_key, query, retry count and test function.

How to use:

npm install --save gimmeproxy-request
const setup = require('gimmeproxy-request').setup;
const request = require('gimmeproxy-request').request;
 
setup({
  api_key: 'your api key', // required
  query: 'supportsHttps=true&anonymityLevel=1&websites=amazon&maxCheckPeriod=600', // additional gimmeproxy query parameters
  retries: 5, // max retries before fail
  test: (body, response) => body.indexOf('captcha') === -1 && response.statusCode === 200 // test function
});
 
request('https://example.com', {
  timeout: 10000 // additional request parameters, see https://github.com/request/request
},
function(err, res, body) {
  console.log('err', err)
  console.log('res', res)
  console.log('body', body)
  process.exit()
});

Keywords

none

install

npm i gimmeproxy-request

Downloadsweekly downloads

41

version

1.0.12

license

MPL-2.0

last publish

collaborators

  • avatar
Report a vulnerability