Created
January 13, 2018 17:17
-
-
Save 0xgeert/57689768eceaec43ae0ddd17949d7503 to your computer and use it in GitHub Desktop.
x-ray driver extended with proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Request = require('request') | |
var r = request.defaults({'proxy':'http://localproxy.com'}) | |
function makeDriver(opts) { | |
if (typeof opts === "function") { | |
var request = opts | |
} else { | |
var request = Request.defaults(opts) | |
} | |
return function driver(context, callback) { | |
var url = context.url | |
request(url, function(err, response, body) { | |
return callback(err, body) | |
}) | |
} | |
} | |
module.exports = makeDriver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or use the below if you want to have a list of proxies under your own control