Prerequisites


You should have the following installed:

  • Latest Node.js version

  • Requests library



You have the option to either ignore certificate-related errors or accept our custom certificate so that we are able to decrypt your traffic (see our User Guide for more information on that). Below you will find two sections that detail how you can accept the custom certificate in your code or ignore the certificate-related errors in your code. 



Accepting the Custom Certificate


You should download the custom certificate:





Example code


Required lines to use Proxy Pilot:

  • const cert = fs.readFileSync(path.resolve(__dirname, './public/ca.pem'));
  • ca: cert
  • tunnel: true,
  • (OPTIONAL - don't use if you are not geo-targetting)   
    • proxyHeaderWhiteList: ['X-Sprious-Region'],
      headers: {
      'X-ProxyPilot-Region': 'GB',


const fs = require('fs');
const path = require('path');

##Note: please replace the ./public/ca.pem with a local path to the ca.pem file on your server and simply remove lines with X-ProxyPilot-Region if you don’t need to use geo-targeting feature##

const cert = fs.readFileSync(path.resolve(__dirname, './public/ca.pem'));
const request = require('request');
request(
    {
        url: 'https://www.amazon.com/dp/B07HNW68ZC/',
        proxy: 'http://PROXY_LOGIN:PROXY_PASS@PROXY_IP:PROXY_PORT',
        ca: cert,
        tunnel: true,
        followAllRedirects: true,
        timeout: 60000,
        method: "GET",
        gzip: true,
        proxyHeaderWhiteList: ['X-Sprious-Region'],
        headers: {
            'X-ProxyPilot-Region': 'GB',
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
        }
    },
    (err, response, body) => {
        console.log(err, body);
    }
);



Ignoring Certificate Errors



Example code 


Required lines to use Proxy Pilot:

  • rejectUnauthorized: false

const request = require('request');
request(
    {
        url: 'https://www.amazon.com/dp/B07HNW68ZC/',
        proxy: 'http://PROXY_LOGIN:PROXY_PASS@PROXY_IP:PROXY_PORT',
        timeout: 60000,
        method: "GET",
        rejectUnauthorized: false,
        gzip: true,
        headers: {
            'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
        }
    },
    (err, response, body) => {
        console.log(err, body);
    }
);