mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-24 04:51:26 +00:00
25 lines
615 B
JavaScript
25 lines
615 B
JavaScript
//rule scheme :
|
|
|
|
module.exports = {
|
|
|
|
|
|
replaceServerResDataAsync: function(req,res,serverResData,callback){
|
|
//add "hello github" to all github pages
|
|
if(req.headers.host == "github.com"){
|
|
serverResData += "hello github";
|
|
}
|
|
callback(serverResData);
|
|
},
|
|
|
|
shouldInterceptHttpsReq :function(req){
|
|
//intercept https://github.com/
|
|
//otherwise, all the https traffic will not go through this proxy
|
|
|
|
// return true;
|
|
if(req.headers.host == "github.com"){
|
|
return true;
|
|
}else{
|
|
return false;
|
|
}
|
|
}
|
|
}; |