Merge remote-tracking branch 'origin'

This commit is contained in:
加里 2014-11-14 10:12:17 +08:00
commit 8e0dc781d3
3 changed files with 26 additions and 3 deletions

View File

@ -345,7 +345,27 @@ function setRules(newRule){
} }
userRule = util.merge(defaultRule,newRule); userRule = util.merge(defaultRule,newRule);
'function' == typeof(userRule.summary) && console.log(userRule.summary());
var functions = [];
if('function' == typeof(userRule.init)){
functions.push(function(cb){
userRule.init(cb);
});
}
if('function' == typeof(userRule.summary)){
functions.push(function(cb){
userRule.summary();
cb(null);
});
}
async.series(functions,function(errors,result){
if(!errors){
console.log(color.green('Anyproxy initialize finished, have a fun!'));
}
});
//'function' == typeof(userRule.init) && console.log(userRule.init());
//'function' == typeof(userRule.summary) && console.log(userRule.summary());
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "anyproxy", "name": "anyproxy",
"version": "2.8.8", "version": "2.8.10",
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.", "description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
"main": "proxy.js", "main": "proxy.js",
"bin": { "bin": {
@ -24,6 +24,7 @@
"test": "nodeunit test.js" "test": "nodeunit test.js"
}, },
"optionalDependencies":{ "optionalDependencies":{
"underscore":"^1.7.0",
"cookie":"^0.1.2", "cookie":"^0.1.2",
"mysql":"^2.5.2", "mysql":"^2.5.2",
"iconv-lite": "^0.4.4", "iconv-lite": "^0.4.4",
@ -34,7 +35,8 @@
"socks5-https-client": "^0.2.2", "socks5-https-client": "^0.2.2",
"http-proxy-agent":"^0.2.6", "http-proxy-agent":"^0.2.6",
"https-proxy-agent":"^0.3.5", "https-proxy-agent":"^0.3.5",
"tcp-ping":"^0.1.1" "tcp-ping":"^0.1.1",
"request":"^2.48.0"
}, },
"repository": { "repository": {
"type":"git", "type":"git",

View File

@ -13,6 +13,7 @@ try{
GLOBAL.util['HttpProxyAgent'] = require('http-proxy-agent'); GLOBAL.util['HttpProxyAgent'] = require('http-proxy-agent');
GLOBAL.util['HttpsProxyAgent'] = require('https-proxy-agent'); GLOBAL.util['HttpsProxyAgent'] = require('https-proxy-agent');
GLOBAL.util['tcp-ping'] = require('tcp-ping'); GLOBAL.util['tcp-ping'] = require('tcp-ping');
GLOBAL.util['request'] = require('request');
GLOBAL.util['async'] = require('async'); GLOBAL.util['async'] = require('async');
}catch(e){} }catch(e){}