mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-05-09 22:38:26 +00:00
23 lines
555 B
JavaScript
23 lines
555 B
JavaScript
|
//rule scheme :
|
||
|
|
||
|
module.exports = {
|
||
|
|
||
|
replaceRequestOption : function(req,option){
|
||
|
//replace request towards http://www.taobao.com
|
||
|
// to http://www.taobao.com/about/
|
||
|
|
||
|
/*
|
||
|
option scheme:
|
||
|
{
|
||
|
hostname : "www.taobao.com"
|
||
|
port : 80
|
||
|
path : "/"
|
||
|
method : "GET"
|
||
|
headers : {cookie:""}
|
||
|
}
|
||
|
*/
|
||
|
if(option.hostname == "www.taobao.com" && option.path == "/"){
|
||
|
option.path = "/about/";
|
||
|
}
|
||
|
}
|
||
|
};
|