Node JS - Making Https Request Via Proxy
Node JS - Making Https Request Via Proxy
CodingMiles.com HOME
Using https-proxy-agent module
and request module
Install the following modules:
Then:
http://codingmiles.com/node-js-making-https-request-via-proxy/ 1/6
3/15/2018 Node JS: Making https request via proxy
Using https-proxy-agent module
and https module
http://codingmiles.com/node-js-making-https-request-via-proxy/ 2/6
3/15/2018 Node JS: Making https request via proxy
},
agent: agent,
timeout: 10000,
followRedirect: true,
maxRedirects: 10
}, function(res) {
res.setEncoding('utf8');
res.on('data', function(chunk) {
console.log('Response: ' + chunk);
});
});
post_req.write("name=john");
post_req.end();
References:
https://nodejs.org/api/https.html
http://blog.vanamco.com/proxy-requests-in-node-js/ (Custom
implementation of HttpsProxyAgent)
https://www.npmjs.com/package/https-proxy-agent
12 Comments CodingMiles
1 Login
Sort by Best
Recommend 2 ⤤ Share
LOG IN WITH
http://codingmiles.com/node-js-making-https-request-via-proxy/ 3/6
3/15/2018 Node JS: Making https request via proxy
LOG IN WITH
OR SIGN UP WITH DISQUS ?
Name
Interesting! Need to check on this to see what's happening exactly under the hood.
Thanks for the insight Rob.
△ ▽ • Reply • Share ›
ALSO ON CODINGMILES
Sorting Algorithms: Selection Sort using Adding custom fonts to react native for
JavaScript Android
5 comments • 3 years ago 2 comments • 2 years ago
Jay — Appreciate it. Thanks! :) Ankur Agarwal — Did you type the correct font
name at fontFamily: 'NewWalt'? Note that
'NewWalt' is not the file name. It is the name
NodeJS – Bulk update to MongoDB using Sorting Algorithms: Insertion Sort using
CONFIG ALGORITHMS
CodingMiles.com © 2018
Latest Posts Ghost
http://codingmiles.com/node-js-making-https-request-via-proxy/ 6/6