Prerequisites
You should have the following installed:
Latest Node.js version
Requests library:
https://www.npmjs.com/package/request
Example code
Required lines to use Proxy Pilot:
- rejectUnauthorized: false
- rejectUnauthorized: false "ignores" the certificate warnings
- rejectUnauthorized: false "ignores" the certificate warnings
- (OPTIONAL) - If you wish to have a secure connection between your server and our server, you can install our certificate and use it in Node.js. For most users, this is not necessary and you can simply "Ignore" the certificate errors. You can download the certificate here.
- // 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',
- // proxyHeaderWhiteList: ['X-Sprious-Region'],
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", rejectUnauthorized: false, 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); } );