update readme and doc

This commit is contained in:
Otto Mao
2017-12-01 21:58:32 +08:00
parent 4be5aa8954
commit 3022f1de18
16 changed files with 43 additions and 108 deletions

View File

@@ -14,6 +14,7 @@ Github主页https://github.com/alibaba/anyproxy/tree/4.x
* 基于Node.js开放二次开发能力允许自定义请求处理逻辑
* 支持Https的解析
* 提供GUI界面用以观察请求
相比3.x版本AnyProxy 4.0的主要变化:
* 规则文件Rule全面支持Promise和Generator
@@ -29,7 +30,7 @@ Github主页https://github.com/alibaba/anyproxy/tree/4.x
对于Debian或者Ubuntu系统在安装AnyProxy之前可能还需要安装 `nodejs-legacy`
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
然后安装AnyProxy
@@ -223,19 +224,11 @@ AnyProxy提供了二次开发的能力你可以用js编写自己的规则模
```js
// file: sample.js
module.exports = {
summary: 'a rule to modify response',
summary: 'a rule to hack response',
*beforeSendResponse(requestDetail, responseDetail) {
if (requestDetail.url === 'http://httpbin.org/user-agent') {
const newResponse = responseDetail.response;
newResponse.body += '<br/><span style="color:blue">-- AnyProxy Hacked! --</span>';
newResponse.body += `<script>
setTimeout(
function (){
window.alert("Sorry, You Are Hacked...")
}, 300);
</script>`;
newResponse.header['Content-Type'] = 'text/html';
newResponse.body += '- AnyProxy Hacked!';
return new Promise((resolve, reject) => {
setTimeout(() => { // delay

View File

@@ -5,7 +5,7 @@
对于Debian或者Ubuntu系统在安装AnyProxy之前可能还需要安装 `nodejs-legacy`
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
然后安装AnyProxy

View File

@@ -14,6 +14,7 @@ Github主页https://github.com/alibaba/anyproxy/tree/4.x
* 基于Node.js开放二次开发能力允许自定义请求处理逻辑
* 支持Https的解析
* 提供GUI界面用以观察请求
相比3.x版本AnyProxy 4.0的主要变化:
* 规则文件Rule全面支持Promise和Generator
@@ -29,7 +30,7 @@ Github主页https://github.com/alibaba/anyproxy/tree/4.x
对于Debian或者Ubuntu系统在安装AnyProxy之前可能还需要安装 `nodejs-legacy`
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
然后安装AnyProxy
@@ -223,19 +224,11 @@ AnyProxy提供了二次开发的能力你可以用js编写自己的规则模
```js
// file: sample.js
module.exports = {
summary: 'a rule to modify response',
summary: 'a rule to hack response',
*beforeSendResponse(requestDetail, responseDetail) {
if (requestDetail.url === 'http://httpbin.org/user-agent') {
const newResponse = responseDetail.response;
newResponse.body += '<br/><span style="color:blue">-- AnyProxy Hacked! --</span>';
newResponse.body += `<script>
setTimeout(
function (){
window.alert("Sorry, You Are Hacked...")
}, 300);
</script>`;
newResponse.header['Content-Type'] = 'text/html';
newResponse.body += '- AnyProxy Hacked!';
return new Promise((resolve, reject) => {
setTimeout(() => { // delay