Created
October 27, 2017 07:39
-
-
Save seeya/de86c2486ae102f71700dfe7677ff18e to your computer and use it in GitHub Desktop.
PAC with nodejs request
This file contains 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
// Using a PAC file with request nodejs | |
// https://blog.birkhoff.me/node-js-request-via-local-pac-file/ | |
// npm install pac-proxy-agent | |
var request = require("request"); | |
var pacURL = 'http://127.0.0.1:16823/proxy_on.pac'; | |
var agent = new require('pac-proxy-agent')('pac+' + pacURL); | |
var reqURL = 'https://www.google.com.tw'; | |
request({ url: reqURL, agent: agent }, function (error, response, body) { | |
// code.. | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HTTPError: Bad Request
my response,i search everywhere, wher is my luck