pac-proxy-agent
Advanced tools
Comparing version 1.0.0 to 1.1.0
1.1.0 / 2017-06-11 | ||
================== | ||
* fix judo | ||
* drop Node < 1 support, test v6, v7 and v8 | ||
* remove older versions from Travis | ||
* update "mocha" to v3.4.2 | ||
* Upgrade pac-resolver | ||
* Merge pull request #5 from piotr1212/use_raw_body | ||
* Merge pull request #9 from shanebdavis/master | ||
* updated get-uri dependency to 2.0; now builds nicely with webpack | ||
* test: add a `sandbox` test case | ||
* remote empty top lines | ||
* travis: test node v1, 2, 3, 4, 5 | ||
* Merge pull request #6 from rustyconover/fix-sandbox-options | ||
* Fix mispelling preventing the setting of sandbox in proxy creation | ||
* update stream-to-buffer to raw-body, stream-to-buffer is deprecated | ||
1.0.0 / 2015-07-10 | ||
@@ -3,0 +21,0 @@ ================== |
@@ -1,2 +0,1 @@ | ||
/** | ||
@@ -34,3 +33,3 @@ * Module exports. | ||
var PacResolver = require('pac-resolver'); | ||
var toBuffer = require('stream-to-buffer'); | ||
var getRawBody = require('raw-body'); | ||
var inherits = require('util').inherits; | ||
@@ -82,3 +81,3 @@ var debug = require('debug')('pac-proxy-agent'); | ||
this.sandbox = opts.sandox; | ||
this.sandbox = opts.sandbox; | ||
@@ -163,3 +162,3 @@ this.proxy = opts; | ||
self.cache = rs; | ||
toBuffer(rs, onbuffer); | ||
getRawBody(rs, 'utf8', onbuffer); | ||
} | ||
@@ -170,3 +169,3 @@ | ||
debug('read %o byte PAC file from URI', buf.length); | ||
fn(null, buf.toString('utf8')); | ||
fn(null, buf); | ||
} | ||
@@ -173,0 +172,0 @@ }; |
{ | ||
"name": "pac-proxy-agent", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A PAC file proxy `http.Agent` implementation for HTTP", | ||
@@ -33,11 +33,11 @@ "main": "index.js", | ||
"extend": "3", | ||
"get-uri": "1", | ||
"get-uri": "2", | ||
"http-proxy-agent": "1", | ||
"https-proxy-agent": "1", | ||
"pac-resolver": "~1.2.1", | ||
"pac-resolver": "~2.0.0", | ||
"socks-proxy-agent": "2", | ||
"stream-to-buffer": "0.1.0" | ||
"raw-body": "2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "2", | ||
"mocha": "^3.4.2", | ||
"proxy": "0.2.3", | ||
@@ -44,0 +44,0 @@ "socksv5": "0.0.6" |
@@ -1,2 +0,1 @@ | ||
/** | ||
@@ -11,3 +10,3 @@ * Module dependencies. | ||
var assert = require('assert'); | ||
var toBuffer = require('stream-to-buffer'); | ||
var getRawBody = require('raw-body'); | ||
var Proxy = require('proxy'); | ||
@@ -109,3 +108,38 @@ var socks = require('socksv5'); | ||
it('should allow a `sandbox` to be passed in', function (done) { | ||
this.slow(1000); | ||
function FindProxyForURL(url, host) { | ||
throw new Error(foo() + bar()); | ||
} | ||
function foo () { | ||
return 'hi'; | ||
} | ||
function asyncBar(fn) { | ||
setTimeout(function () { | ||
fn(null, 'fooooo'); | ||
}, 200); | ||
} | ||
asyncBar.async = true; | ||
var uri = 'data:,' + encodeURIComponent(FindProxyForURL.toString()); | ||
var agent = new PacProxyAgent(uri, { | ||
sandbox: { | ||
foo: foo, | ||
bar: asyncBar | ||
} | ||
}); | ||
var opts = url.parse('http://127.0.0.1:' + httpPort + '/test'); | ||
opts.agent = agent; | ||
var req = http.get(opts); | ||
req.once('error', function (err) { | ||
assert.equal(err.message, 'hifooooo'); | ||
done(); | ||
}); | ||
}); | ||
describe('constructor', function () { | ||
@@ -149,5 +183,5 @@ it('should throw an Error if no "proxy" argument is given', function () { | ||
var req = http.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpPort, data.host); | ||
@@ -179,5 +213,5 @@ assert('via' in data); | ||
var req = http.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpPort, data.host); | ||
@@ -207,5 +241,5 @@ assert('via' in data); | ||
var req = http.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpPort, data.host); | ||
@@ -239,5 +273,5 @@ done(); | ||
var req = https.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpsPort, data.host); | ||
@@ -271,5 +305,5 @@ done(); | ||
var req = https.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpsPort, data.host); | ||
@@ -302,5 +336,5 @@ assert(gotReq); | ||
var req = https.get(opts, function (res) { | ||
toBuffer(res, function (err, buf) { | ||
getRawBody(res, 'utf8', function (err, buf) { | ||
if (err) return done(err); | ||
var data = JSON.parse(buf.toString('utf8')); | ||
var data = JSON.parse(buf); | ||
assert.equal('127.0.0.1:' + httpsPort, data.host); | ||
@@ -307,0 +341,0 @@ assert(gotReq); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24887
505
+ Addedraw-body@2
+ Addedbytes@3.1.2(transitive)
+ Addeddata-uri-to-buffer@1.2.0(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedget-uri@2.0.4(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedip@1.0.1(transitive)
+ Addedpac-resolver@2.0.0(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedunpipe@1.0.0(transitive)
- Removedstream-to-buffer@0.1.0
- Removedacorn@5.7.4(transitive)
- Removedalign-text@0.1.4(transitive)
- Removedalter@0.2.0(transitive)
- Removedast-traverse@0.1.1(transitive)
- Removedast-types@0.8.120.9.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbreakable@1.0.0(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcenter-align@0.1.3(transitive)
- Removedcliui@2.1.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddata-uri-to-buffer@0.0.4(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddefs@1.1.1(transitive)
- Removeddetective@4.7.1(transitive)
- Removedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
- Removedfile-uri-to-path@0.0.2(transitive)
- Removedget-uri@1.1.0(transitive)
- Removedglob@5.0.15(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinvert-kv@1.0.0(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedkind-of@3.2.2(transitive)
- Removedlazy-cache@1.0.4(transitive)
- Removedlcid@1.0.0(transitive)
- Removedlongest@1.0.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedpac-resolver@1.2.6(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprivate@0.1.8(transitive)
- Removedq@1.5.1(transitive)
- Removedrecast@0.10.330.11.23(transitive)
- Removedregenerator@0.8.46(transitive)
- Removedregenerator-runtime@0.9.6(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedright-align@0.1.3(transitive)
- Removedsimple-fmt@0.1.0(transitive)
- Removedsimple-is@0.2.0(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedstable@0.1.8(transitive)
- Removedstream-to@0.2.2(transitive)
- Removedstream-to-buffer@0.1.0(transitive)
- Removedstringmap@0.2.2(transitive)
- Removedstringset@0.2.1(transitive)
- Removedthrough@2.3.8(transitive)
- Removedtryor@0.1.2(transitive)
- Removedwindow-size@0.1.4(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyargs@3.27.0(transitive)
Updatedget-uri@2
Updatedpac-resolver@~2.0.0