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

@@ -29,7 +29,7 @@ Change Logs since 3.x:
To Debian and Ubuntu users, you may need to install `nodejs-legacy` at the same time
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
Then install the AnyProxy
@@ -222,20 +222,11 @@ Rule module could do the following stuff:
```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

@@ -4,7 +4,7 @@
To Debian and Ubuntu users, you may need to install `nodejs-legacy` at the same time
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
Then install the AnyProxy

View File

@@ -29,7 +29,7 @@ Change Logs since 3.x:
To Debian and Ubuntu users, you may need to install `nodejs-legacy` at the same time
```bash
sudo apg-get install nodejs-legacy
sudo apt-get install nodejs-legacy
```
Then install the AnyProxy
@@ -222,20 +222,11 @@ Rule module could do the following stuff:
```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