pac-resolver
Advanced tools
Comparing version 1.0.0 to 1.1.0
1.1.0 / 2014-01-25 | ||
================== | ||
* index: make the `filename` configurable | ||
* index: make the `sandbox` configurable | ||
* index: add an `opts` argument | ||
* README++ | ||
1.0.0 / 2014-01-08 | ||
@@ -3,0 +11,0 @@ ================== |
13
index.js
@@ -61,6 +61,7 @@ | ||
* @param {String} str JS string | ||
* @param {Object} opts optional "options" object | ||
* @return {Function} async resolver function | ||
*/ | ||
function generate (str) { | ||
function generate (str, opts) { | ||
@@ -76,3 +77,2 @@ // convert the JS FindProxyForURL function into | ||
// the sandbox to use for the vm | ||
// TODO: make configurable | ||
var sandbox = { | ||
@@ -92,2 +92,8 @@ dateRange: dateRange, | ||
}; | ||
if (opts && opts.sandbox) { | ||
// copy the properties from the user-provided `sandbox` onto ours | ||
for (var i in opts.sandbox) { | ||
sandbox[i] = opts.sandbox[i]; | ||
} | ||
} | ||
@@ -98,4 +104,3 @@ // for `facebook/regnerator` | ||
// filename of the pac file for the vm | ||
// TODO: make configurable | ||
var filename = 'proxy.pac'; | ||
var filename = opts && opts.filename ? opts.filename : 'proxy.pac'; | ||
@@ -102,0 +107,0 @@ // evaluate the JS string and extract the FindProxyForURL generator function |
{ | ||
"name": "pac-resolver", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Generates an asynchronous resolver function from a PAC file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,4 +29,7 @@ pac-resolver | ||
function FindProxyForURL(url, host) { | ||
if (isInNet(myIpAddress(), "10.1.10.0", "255.255.255.0")) | ||
if (isInNet(myIpAddress(), "10.1.10.0", "255.255.255.0")) { | ||
return "PROXY 1.2.3.4:8080"; | ||
} else { | ||
return "DIRECT"; | ||
} | ||
} | ||
@@ -33,0 +36,0 @@ ``` |
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
34661
973
90