2014-09-01 16:38:43 +08:00
|
|
|
//rule scheme :
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
|
|
|
2014-10-21 11:18:55 +08:00
|
|
|
replaceServerResDataAsync: function(req,res,serverResData,callback){
|
2014-09-01 16:38:43 +08:00
|
|
|
//add "hello github" to all github pages
|
|
|
|
if(req.headers.host == "github.com"){
|
|
|
|
serverResData += "hello github";
|
|
|
|
}
|
2014-10-21 11:18:55 +08:00
|
|
|
callback(serverResData);
|
2014-09-01 16:38:43 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
shouldInterceptHttpsReq :function(req){
|
|
|
|
//intercept https://github.com/
|
|
|
|
//otherwise, all the https traffic will not go through this proxy
|
|
|
|
|
2014-09-11 12:04:06 +08:00
|
|
|
// return true;
|
2014-09-01 16:38:43 +08:00
|
|
|
if(req.headers.host == "github.com"){
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|