I would like to write an application using Node.js. The purpose of application is to download the file specified in URL, by giving the URL parameter. For instance, I would like to download .png file in URL http://i.cdn.turner.com/cnn/.e/img/3.0/global/header/intl/CNNi_Logo_new.png. I can write that code. But I don't want the other side to see my IP (xxx.xxx.xxx.xxx). I want to use a public proxy while downloading this file. I mean that when I download this file, my IP must appear as 209.170.151.142:7808 for example (one of the IP addresses in http://free-proxy-list.net/), but not my IP.
How I can code this in node.js?
regards...
The request module can take a proxy configuration option: https://github.com/mikeal/request
Something like this (untested):
var request = require('request');
request({
url: 'http://domain.com/path/to/image.png',
proxy: 'http://IP.of.proxy'
}, function (err, res, imgBuffer) {
// check for presence of err here
// do something with imgBuffer, like save it to a file
})