From bed132d7c5feac085181acc285f776c3c9ef928c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=A0=E9=87=8C?= Date: Wed, 3 Sep 2014 15:39:31 +0800 Subject: [PATCH] update doc --- lib/rule_default.js | 4 ++++ package.json | 4 ++-- rule_sample/rule__blank.js | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/rule_default.js b/lib/rule_default.js index 9f2294c..54dffa1 100644 --- a/lib/rule_default.js +++ b/lib/rule_default.js @@ -1,4 +1,8 @@ module.exports = { + summary:function(){ + console.log("this is the default rule for anyproxy, which supports CORS request"); + }, + shouldUseLocalResponse : function(req,reqBody){ //intercept all options request if(req.method == "OPTIONS"){ diff --git a/package.json b/package.json index fbf4fe6..a9340cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anyproxy", - "version": "2.1.1", + "version": "2.1.2", "description": "a charles/fiddler like proxy written in NodeJs, which can handle HTTPS requests and CROS perfectly.", "main": "proxy.js", "bin": { @@ -19,7 +19,7 @@ "iconv-lite": "^0.4.4" }, "devDependencies": { - "tunnel": "0.0.3" + }, "scripts": { "test": "nodeunit test.js" diff --git a/rule_sample/rule__blank.js b/rule_sample/rule__blank.js index c8517cd..e7f8f1e 100644 --- a/rule_sample/rule__blank.js +++ b/rule_sample/rule__blank.js @@ -2,6 +2,9 @@ module.exports = { /* these functions will overwrite the default ones, write your own when necessary. */ + summary:function(){ + console.log("this is a blank rule for anyproxy"); + }, //whether to intercept this request by local logic //if the return value is true, anyproxy will call dealLocalResponse to get response data and will not send request to remote server anymore