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