mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-10 06:48:26 +00:00
smart intercept https request when rootCA exists
This commit is contained in:
parent
cb813f8cb5
commit
e9813a1b44
@ -8,7 +8,6 @@ var exec = require('child_process').exec,
|
|||||||
util = require('./util'),
|
util = require('./util'),
|
||||||
asyncTask = require("async-task-mgr");
|
asyncTask = require("async-task-mgr");
|
||||||
|
|
||||||
//TODO : move root cert from cmd to cert
|
|
||||||
var certDir = path.join(util.getUserHome(),"/.anyproxy_certs/"),
|
var certDir = path.join(util.getUserHome(),"/.anyproxy_certs/"),
|
||||||
cmdDir = path.join(__dirname,"..","./cert/"),
|
cmdDir = path.join(__dirname,"..","./cert/"),
|
||||||
cmd_genRoot = path.join(cmdDir,"./gen-rootCA"),
|
cmd_genRoot = path.join(cmdDir,"./gen-rootCA"),
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
|
var isRootCAFileExists = require("./certMgr.js").isRootCAFileExists();
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
summary:function(){
|
summary:function(){
|
||||||
return "the default rule for anyproxy, support : CORS / HTTPS(if root cert is ready)";
|
var tip = "the default rule for anyproxy, support : CORS";
|
||||||
|
if(isRootCAFileExists){
|
||||||
|
tip += "\nRoot CA exists, will intercept all https requests for you";
|
||||||
|
}
|
||||||
|
return tip;
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldUseLocalResponse : function(req,reqBody){
|
shouldUseLocalResponse : function(req,reqBody){
|
||||||
@ -41,7 +47,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
shouldInterceptHttpsReq :function(req){
|
shouldInterceptHttpsReq :function(req){
|
||||||
return false;
|
return isRootCAFileExists;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "anyproxy",
|
"name": "anyproxy",
|
||||||
"version": "2.3.9",
|
"version": "2.4.0",
|
||||||
"description": "a charles/fiddler like proxy written in NodeJs, which can handle HTTPS requests and CROS perfectly.",
|
"description": "A fully configurable proxy in NodeJS, which can handle HTTPS requests perfectly.",
|
||||||
"main": "proxy.js",
|
"main": "proxy.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
"anyproxy": "bin.js"
|
"anyproxy": "bin.js"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user