Making use of postman-request, an HTTP client:


var request = require('postman-request');
var fs = require('fs');


var proxyRequest = request.defaults({
'proxy': 'http://<API KEY>:@proxy.crawlera.com:8011'
});

var options = {
url: 'https://twitter.com',
ca: fs.readFileSync("/path/to/zyte-smartproxy-ca.crt"),
requestCert: true,
rejectUnauthorized: true
};

function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(response.headers);
console.log(body);
}
else{
console.log(error, response, body);
}
}

proxyRequest(options, callback);


Zyte Smart Proxy Manager(formerly Crawlera) Certificate Authority can be downloaded here: zyte-smartproxy-ca.crt.