mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-24 16:51:29 +00:00
23 lines
620 B
JavaScript
23 lines
620 B
JavaScript
/*
|
|
read the following wiki before using rule file
|
|
https://github.com/alibaba/anyproxy/wiki/What-is-rule-file-and-how-to-write-one
|
|
*/
|
|
module.exports = {
|
|
|
|
summary:function(){
|
|
return "reverse proxy - assign an IP adress for some request";
|
|
},
|
|
|
|
replaceRequestOption : function(req,option){
|
|
var newOption = option;
|
|
|
|
//options : http://nodejs.org/api/http.html#http_http_request_options_callback
|
|
if(newOption.headers.host == "www.taobao.com"){
|
|
newOption.hostname = "127.0.0.1";
|
|
newOption.port = "80";
|
|
}
|
|
|
|
return newOption;
|
|
}
|
|
|
|
}; |