update document

This commit is contained in:
xiaofeng.mxf 2019-03-26 20:56:25 +08:00
parent 01e0b01949
commit 2f63cd96c1
13 changed files with 45 additions and 38 deletions

3
.gitignore vendored
View File

@ -34,4 +34,5 @@ test/report
*.tgz
doc_compiled.md
docs-md/cn/doc.md
docs-md/en/doc.md
docs-md/en/doc.md
docs/gitbook/gitbook-plugin-livereload/

View File

@ -536,8 +536,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_use_local_response.js
```
```js
/*
sample:
/*
sample:
intercept all requests toward httpbin.org, use a local response
test:
curl http://httpbin.org/user-agent --proxy http://127.0.0.1:8001
@ -566,8 +566,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_request_header.js
```
```js
/*
sample:
/*
sample:
modify the user-agent in requests toward httpbin.org
test:
curl http://httpbin.org/user-agent --proxy http://127.0.0.1:8001
@ -655,8 +655,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_request_protocol.js
```
```js
/*
sample:
/*
sample:
redirect all http requests of httpbin.org to https
test:
curl 'http://httpbin.org/get?show_env=1' --proxy http://127.0.0.1:8001
@ -685,8 +685,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_statuscode.js
```
```js
/*
sample:
/*
sample:
modify all status code of http://httpbin.org/ to 404
test:
curl -I 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -714,8 +714,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_header.js
```
```js
/*
sample:
/*
sample:
modify response header of http://httpbin.org/user-agent
test:
curl -I 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -743,8 +743,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_data.js
```
```js
/*
sample:
/*
sample:
modify response data of http://httpbin.org/user-agent
test:
curl 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -827,7 +827,7 @@ module.exports = {
* 设置 -> 安全性与位置信息 -> 加密与凭据 -> 从存储设备安装。找到你下载的证书文件,进行安装
* 设置 -> 安全 -> 从SD卡安装证书。找到你下载的证书文件进行安装
不同安卓系统支持安装的证书文件类型不尽相同,大多数系统支持安装拓展名为 .crt 的证书文件,少部分仅支持 .cer 文件(已知如 OPPO R15AnyProxy 提供了多种类型的证书文件可在下载安装时选择。
不同安卓系统支持安装的证书文件类型不尽相同,大多支持安装拓展名为 .crt 的证书文件,少部分仅支持 .cer 文件(已知如 OPPO R15AnyProxy 提供了多种类型的证书文件可在下载安装时选择。
### 配置iOS/Android系统代理

View File

@ -628,7 +628,7 @@ module.exports = {
* 设置 -> 安全性与位置信息 -> 加密与凭据 -> 从存储设备安装。找到你下载的证书文件,进行安装
* 设置 -> 安全 -> 从SD卡安装证书。找到你下载的证书文件进行安装
不同安卓系统支持安装的证书文件类型不尽相同,大多数系统支持安装拓展名为 .crt 的证书文件,少部分仅支持 .cer 文件(已知如 OPPO R15AnyProxy 提供了多种类型的证书文件可在下载安装时选择。
不同安卓系统支持安装的证书文件类型不尽相同,大多支持安装拓展名为 .crt 的证书文件,少部分仅支持 .cer 文件(已知如 OPPO R15AnyProxy 提供了多种类型的证书文件可在下载安装时选择。
### 配置iOS/Android系统代理

View File

@ -528,8 +528,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_use_local_response.js
```
```js
/*
sample:
/*
sample:
intercept all requests toward httpbin.org, use a local response
test:
curl http://httpbin.org/user-agent --proxy http://127.0.0.1:8001
@ -558,8 +558,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_request_header.js
```
```js
/*
sample:
/*
sample:
modify the user-agent in requests toward httpbin.org
test:
curl http://httpbin.org/user-agent --proxy http://127.0.0.1:8001
@ -647,8 +647,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_request_protocol.js
```
```js
/*
sample:
/*
sample:
redirect all http requests of httpbin.org to https
test:
curl 'http://httpbin.org/get?show_env=1' --proxy http://127.0.0.1:8001
@ -677,8 +677,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_statuscode.js
```
```js
/*
sample:
/*
sample:
modify all status code of http://httpbin.org/ to 404
test:
curl -I 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -706,8 +706,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_header.js
```
```js
/*
sample:
/*
sample:
modify response header of http://httpbin.org/user-agent
test:
curl -I 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -735,8 +735,8 @@ module.exports = {
anyproxy --rule rule_sample/sample_modify_response_data.js
```
```js
/*
sample:
/*
sample:
modify response data of http://httpbin.org/user-agent
test:
curl 'http://httpbin.org/user-agent' --proxy http://127.0.0.1:8001
@ -820,7 +820,7 @@ Installing CA in Android could be different based on the system, we list some co
* Settings -> Security & Location > Encryption & credentials -> Install from storage, and find your CA file to install
* Settings -> Security -> Install from SD card, and find you CA file to install
As we known, there are several file extensions of CA file which may not be recognised by all kinds of Android. The .crt file is the most popular, and a few systems only support .cer file such as OPPO R15. In AnyProxy, you can choose the type of file you need before installing the root CA to your devices.
There are several file extensions of CA file which may not be compatible with all kinds of Android phones. `.crt` file is the most popular, while a few systems could only use .cer file such as OPPO R15. In AnyProxy, you can choose the type of certificate you need before installing.
### config iOS/Android proxy server

View File

@ -621,7 +621,7 @@ Installing CA in Android could be different based on the system, we list some co
* Settings -> Security & Location > Encryption & credentials -> Install from storage, and find your CA file to install
* Settings -> Security -> Install from SD card, and find you CA file to install
As we known, there are several file extensions of CA file which may not be recognised by all kinds of Android. The .crt file is the most popular, and a few systems only support .cer file such as OPPO R15. In AnyProxy, you can choose the type of file you need before installing the root CA to your devices.
There are several file extensions of CA file which may not be compatible with all kinds of Android phones. `.crt` file is the most popular, while a few systems could only use .cer file such as OPPO R15. In AnyProxy, you can choose the type of certificate you need before installing.
### config iOS/Android proxy server

View File

@ -1561,6 +1561,7 @@ newResponse.body += <span class="hljs-string">&apos;--from anyproxy--&apos;</spa
</ul>
</li>
</ul>
<p>&#x4E0D;&#x540C;&#x5B89;&#x5353;&#x7CFB;&#x7EDF;&#x652F;&#x6301;&#x5B89;&#x88C5;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#x7C7B;&#x578B;&#x4E0D;&#x5C3D;&#x76F8;&#x540C;&#xFF0C;&#x5927;&#x591A;&#x652F;&#x6301;&#x5B89;&#x88C5;&#x62D3;&#x5C55;&#x540D;&#x4E3A; .crt &#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF0C;&#x5C11;&#x90E8;&#x5206;&#x4EC5;&#x652F;&#x6301; .cer &#x6587;&#x4EF6;&#xFF08;&#x5DF2;&#x77E5;&#x5982; OPPO R15&#xFF09;&#xFF0C;AnyProxy &#x63D0;&#x4F9B;&#x4E86;&#x591A;&#x79CD;&#x7C7B;&#x578B;&#x7684;&#x8BC1;&#x4E66;&#x6587;&#x4EF6;&#xFF0C;&#x53EF;&#x5728;&#x4E0B;&#x8F7D;&#x5B89;&#x88C5;&#x65F6;&#x9009;&#x62E9;&#x3002;</p>
<h3 id="&#x914D;&#x7F6E;iosandroid&#x7CFB;&#x7EDF;&#x4EE3;&#x7406;">&#x914D;&#x7F6E;iOS/Android&#x7CFB;&#x7EDF;&#x4EE3;&#x7406;</h3>
<ul>
<li><p>&#x4EE3;&#x7406;&#x670D;&#x52A1;&#x5668;&#x90FD;&#x5728;wifi&#x8BBE;&#x7F6E;&#x4E2D;&#x914D;&#x7F6E;</p>
@ -1658,7 +1659,7 @@ newResponse.body += <span class="hljs-string">&apos;--from anyproxy--&apos;</spa
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"简介","level":"1.1","depth":1,"next":{"title":"快速开始","level":"1.2","depth":1,"anchor":"#快速开始","path":"README.md","ref":"README.md#快速开始","articles":[{"title":"安装","level":"1.2.1","depth":2,"anchor":"#安装","path":"README.md","ref":"README.md#安装","articles":[]},{"title":"启动","level":"1.2.2","depth":2,"anchor":"#启动","path":"README.md","ref":"README.md#启动","articles":[]},{"title":"其他命令","level":"1.2.3","depth":2,"anchor":"#其他命令","path":"README.md","ref":"README.md#其他命令","articles":[]},{"title":"作为npm模块启动","level":"1.2.4","depth":2,"anchor":"#作为npm模块使用","path":"README.md","ref":"README.md#作为npm模块使用","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"AnyProxy","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AnyProxy","language":"cn","gitbook":"*","description":"A fully configurable http/https proxy in NodeJS"},"file":{"path":"README.md","mtime":"2019-03-24T13:17:35.024Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2019-03-24T13:17:35.950Z"},"basePath":".","book":{"language":"cn"}});
gitbook.page.hasChanged({"page":{"title":"简介","level":"1.1","depth":1,"next":{"title":"快速开始","level":"1.2","depth":1,"anchor":"#快速开始","path":"README.md","ref":"README.md#快速开始","articles":[{"title":"安装","level":"1.2.1","depth":2,"anchor":"#安装","path":"README.md","ref":"README.md#安装","articles":[]},{"title":"启动","level":"1.2.2","depth":2,"anchor":"#启动","path":"README.md","ref":"README.md#启动","articles":[]},{"title":"其他命令","level":"1.2.3","depth":2,"anchor":"#其他命令","path":"README.md","ref":"README.md#其他命令","articles":[]},{"title":"作为npm模块启动","level":"1.2.4","depth":2,"anchor":"#作为npm模块使用","path":"README.md","ref":"README.md#作为npm模块使用","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"AnyProxy","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AnyProxy","language":"cn","gitbook":"*","description":"A fully configurable http/https proxy in NodeJS"},"file":{"path":"README.md","mtime":"2019-03-26T12:49:35.827Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2019-03-26T12:49:36.852Z"},"basePath":".","book":{"language":"cn"}});
});
</script>
</div>

File diff suppressed because one or more lines are too long

View File

@ -628,6 +628,8 @@ module.exports = {
* 设置 -> 安全性与位置信息 -> 加密与凭据 -> 从存储设备安装。找到你下载的证书文件,进行安装
* 设置 -> 安全 -> 从SD卡安装证书。找到你下载的证书文件进行安装
不同安卓系统支持安装的证书文件类型不尽相同,大多支持安装拓展名为 .crt 的证书文件,少部分仅支持 .cer 文件(已知如 OPPO R15AnyProxy 提供了多种类型的证书文件,可在下载安装时选择。
### 配置iOS/Android系统代理
* 代理服务器都在wifi设置中配置

View File

@ -1532,6 +1532,7 @@ newResponse.body += <span class="hljs-string">&apos;--from anyproxy--&apos;</spa
<ul>
<li>Besides installing root CA, you have to &quot;turn on&quot; the certificate for web manually in <em>settings - general - about - Certificate Trust Settings</em>. Otherwire, safari will not trust the root CA generated by AnyProxy.</li>
</ul>
<p><img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500"></p>
<h3 id="trust-root-ca-in-android">trust root CA in Android</h3>
<p>First of all, you need to download the root CA by clicking <em>Root CA</em> in web ui, and then scan the QR code.
Installing CA in Android could be different based on the system, we list some common steps as below, but you can find the right way in you system with similar menu path.</p>
@ -1543,7 +1544,7 @@ Installing CA in Android could be different based on the system, we list some co
</ul>
</li>
</ul>
<p><img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500"></p>
<p>There are several file extensions of CA file which may not be compatible with all kinds of Android phones. <code>.crt</code> file is the most popular, while a few systems could only use .cer file such as OPPO R15. In AnyProxy, you can choose the type of certificate you need before installing.</p>
<h3 id="config-iosandroid-proxy-server">config iOS/Android proxy server</h3>
<ul>
<li><p>proxy settings are placed in wifi setting</p>
@ -1646,7 +1647,7 @@ You can change the request with rule of course. For this scenario, all you need
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Getting-Start","level":"1.2","depth":1,"anchor":"#getting-start","path":"README.md","ref":"README.md#getting-start","articles":[{"title":"Install","level":"1.2.1","depth":2,"anchor":"#install","path":"README.md","ref":"README.md#install","articles":[]},{"title":"Launch","level":"1.2.2","depth":2,"anchor":"#launch","path":"README.md","ref":"README.md#launch","articles":[]},{"title":"Options","level":"1.2.3","depth":2,"anchor":"#options","path":"README.md","ref":"README.md#options","articles":[]},{"title":"As Node Module","level":"1.2.4","depth":2,"anchor":"#use-anyproxy-as-an-npm-module","path":"README.md","ref":"README.md#use-anyproxy-as-an-npm-module","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"AnyProxy","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AnyProxy","language":"en","gitbook":"*","description":"A fully configurable http/https proxy in NodeJS"},"file":{"path":"README.md","mtime":"2019-03-24T13:17:35.025Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2019-03-24T13:17:35.950Z"},"basePath":".","book":{"language":"en"}});
gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Getting-Start","level":"1.2","depth":1,"anchor":"#getting-start","path":"README.md","ref":"README.md#getting-start","articles":[{"title":"Install","level":"1.2.1","depth":2,"anchor":"#install","path":"README.md","ref":"README.md#install","articles":[]},{"title":"Launch","level":"1.2.2","depth":2,"anchor":"#launch","path":"README.md","ref":"README.md#launch","articles":[]},{"title":"Options","level":"1.2.3","depth":2,"anchor":"#options","path":"README.md","ref":"README.md#options","articles":[]},{"title":"As Node Module","level":"1.2.4","depth":2,"anchor":"#use-anyproxy-as-an-npm-module","path":"README.md","ref":"README.md#use-anyproxy-as-an-npm-module","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css"},"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"AnyProxy","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"AnyProxy","language":"en","gitbook":"*","description":"A fully configurable http/https proxy in NodeJS"},"file":{"path":"README.md","mtime":"2019-03-26T12:49:35.828Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2019-03-26T12:49:36.852Z"},"basePath":".","book":{"language":"en"}});
});
</script>
</div>

File diff suppressed because one or more lines are too long

View File

@ -610,6 +610,8 @@ install
* Besides installing root CA, you have to "turn on" the certificate for web manually in *settings - general - about - Certificate Trust Settings*. Otherwire, safari will not trust the root CA generated by AnyProxy.
<img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500" />
### trust root CA in Android
First of all, you need to download the root CA by clicking *Root CA* in web ui, and then scan the QR code.
Installing CA in Android could be different based on the system, we list some common steps as below, but you can find the right way in you system with similar menu path.
@ -619,7 +621,7 @@ Installing CA in Android could be different based on the system, we list some co
* Settings -> Security & Location > Encryption & credentials -> Install from storage, and find your CA file to install
* Settings -> Security -> Install from SD card, and find you CA file to install
<img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500" />
There are several file extensions of CA file which may not be compatible with all kinds of Android phones. `.crt` file is the most popular, while a few systems could only use .cer file such as OPPO R15. In AnyProxy, you can choose the type of certificate you need before installing.
### config iOS/Android proxy server

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ const { directGet } = require('../util/HttpUtil.js');
describe('WebInterface server', () => {
let webServer = null;
let webHost = 'http://127.0.0.1:8002';
const webHost = 'http://127.0.0.1:8002'
beforeAll(() => {
const recorder = new Recorder();
@ -27,4 +27,4 @@ describe('WebInterface server', () => {
})
.catch(done);
});
});
});