update https features

This commit is contained in:
OttoMao
2015-01-22 10:16:19 +08:00
parent df33805e17
commit de3ba93a61
6 changed files with 34 additions and 24 deletions

View File

@@ -1,10 +1,11 @@
var isRootCAFileExists = require("./certMgr.js").isRootCAFileExists();
var isRootCAFileExists = require("./certMgr.js").isRootCAFileExists(),
interceptFlag = false;
module.exports = {
summary:function(){
var tip = "the default rule for anyproxy, support : CORS. ";
if(isRootCAFileExists){
tip += "\nRoot CA exists, will intercept all https requests.";
if(!isRootCAFileExists){
tip += "\nRoot CA does not exist, will not intercept any https requests.";
}
return tip;
},
@@ -53,14 +54,14 @@ module.exports = {
},
shouldInterceptHttpsReq:function(req){
// return false;
return isRootCAFileExists;
return interceptFlag;
},
//[beta]
//fetch entire traffic data
fetchTrafficData: function(id,info){},
//[internal]
customMenu:[
{
name :"test",
@@ -69,7 +70,11 @@ module.exports = {
name :"second-test",
handler :function(){}
}
]
],
setInterceptFlag:function(flag){
interceptFlag = flag && isRootCAFileExists;
}
};