Skip to content

Instantly share code, notes, and snippets.

@steveinatorx
Last active August 10, 2016 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveinatorx/eb53136738a88d1b2097517036512757 to your computer and use it in GitHub Desktop.
Save steveinatorx/eb53136738a88d1b2097517036512757 to your computer and use it in GitHub Desktop.
'use strict';
var apiDispatcher = require ('../apiDispatcher');
var request = require ('request');
var async = require ('async');
apiDispatcher.getURIs('foo.com')
.then(function(res){
var uris=JSON.parse(res);
async.each(uris, function(uri,tick){
var proxiedRequest = request.defaults({'proxy':'http://my-proxy.com:12345'});
proxiedRequest.get(uri,function(err,res,body){
console.log(body);
tick();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment