mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
update https features
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user