Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pac-proxy-agent

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pac-proxy-agent - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

18

History.md
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 @@ ==================

9

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc