mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-27 16:05:14 +00:00
update
This commit is contained in:
@@ -5,6 +5,7 @@ var http = require("http"),
|
||||
url = require("url"),
|
||||
pathUtil = require("path"),
|
||||
color = require("colorful"),
|
||||
sleep = require("sleep"),
|
||||
httpsServerMgr = require("./httpsServerMgr");
|
||||
|
||||
var httpsServerMgrInstance = new httpsServerMgr();
|
||||
@@ -77,6 +78,13 @@ function userRequestHandler(req,userRes){
|
||||
console.log("file not exist : " + targetLocalfile);
|
||||
}
|
||||
}
|
||||
|
||||
//sleep for seconds if configed in the rule file
|
||||
//see rule_sample.js
|
||||
if(hostTest && pathTest && !!rule.sleep){
|
||||
console.log(color.yellow('[' + req.url + '] will sleep for ' + rule.sleep + ' seconds'));
|
||||
sleep.sleep(rule.sleep);
|
||||
}
|
||||
}
|
||||
|
||||
if(ifLocalruleMatched){
|
||||
|
Reference in New Issue
Block a user