mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-04 21:39:04 +00:00
add new sample for ip binding
This commit is contained in:
13
rule_sample/rule_assign_ip_address.js
Normal file
13
rule_sample/rule_assign_ip_address.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//sample : assign 127.0.0.1 to www.taobao.com
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
|
||||||
|
replaceRequestOption : function(req,option){
|
||||||
|
if(option.hostname == "www.taobao.com"){
|
||||||
|
option.hostname = "127.0.0.1";
|
||||||
|
}
|
||||||
|
|
||||||
|
return option;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user