1.fix record issue with https 2.rewrite rule scheme

This commit is contained in:
加里
2014-09-01 16:38:43 +08:00
parent 0f4c1ac017
commit 48fb1cbe40
20 changed files with 633 additions and 373 deletions

View File

@@ -0,0 +1,41 @@
//rule scheme :
module.exports = {
shouldUseLocalResponse : function(req){
},
dealLocalResponse : function(req,callback){
},
replaceRequestOption : function(req,option){
},
replaceRequestProtocol:function(req,protocol){
},
replaceResponseStatusCode: function(req,res,statusCode){
},
replaceResponseHeader: function(req,res,header){
},
replaceServerResData: function(req,res,serverResData){
//append "hello world" to all web pages
if(/html/i.test(res.headers['content-type'])){
var newDataStr = serverResData.toString();
newDataStr += "hello world!";
return newDataStr;
}else{
return serverResData;
}
},
pauseBeforeSendingResponse : function(req,res){
},
shouldInterceptHttpsReq :function(req){
}
};