mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-04-23 20:31:25 +00:00
update faq
This commit is contained in:
parent
8bc5aa1b72
commit
c4e6aeb3e7
38
cn.html
38
cn.html
@ -74,6 +74,8 @@
|
|||||||
<li class="sidebar-header-3"><a href="#ios系统信任ca证书">iOS系统信任CA证书</a></li>
|
<li class="sidebar-header-3"><a href="#ios系统信任ca证书">iOS系统信任CA证书</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#ios->=-10.3信任ca证书">iOS >= 10.3信任CA证书</a></li>
|
<li class="sidebar-header-3"><a href="#ios->=-10.3信任ca证书">iOS >= 10.3信任CA证书</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#配置ios/android系统代理">配置iOS/Android系统代理</a></li>
|
<li class="sidebar-header-3"><a href="#配置ios/android系统代理">配置iOS/Android系统代理</a></li>
|
||||||
|
<li class="sidebar-header-2"><a href="#faq-1">FAQ</a></li>
|
||||||
|
<li class="sidebar-header-3"><a href="#the-connection-is-not-private">The connection is not private</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -99,6 +101,8 @@
|
|||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
||||||
<h2 id="快速上手"><a class="header-link" href="#快速上手"></a>快速上手</h2>
|
<h2 id="快速上手"><a class="header-link" href="#快速上手"></a>快速上手</h2>
|
||||||
<h3 id="安装"><a class="header-link" href="#安装"></a>安装</h3>
|
<h3 id="安装"><a class="header-link" href="#安装"></a>安装</h3>
|
||||||
|
<p>对于Debian或者Ubuntu系统,在安装AnyProxy之前,可能还需要安装 <code>nodejs-legacy</code></p>
|
||||||
|
<pre class="hljs"><code>sudo apg-get install nodejs-legacy</code></pre><p>然后,安装AnyProxy</p>
|
||||||
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment">#本文档对应的AnyProxy为4.0Beta版</span></code></pre><h3 id="启动"><a class="header-link" href="#启动"></a>启动</h3>
|
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment">#本文档对应的AnyProxy为4.0Beta版</span></code></pre><h3 id="启动"><a class="header-link" href="#启动"></a>启动</h3>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li>命令行启动AnyProxy,默认端口号8001</li>
|
<li>命令行启动AnyProxy,默认端口号8001</li>
|
||||||
@ -772,7 +776,7 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
|||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/BrugmMelGVysLDOIBblj.png" width="260" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/BrugmMelGVysLDOIBblj.png" width="260" /></p>
|
||||||
<h3 id="ios->=-10.3信任ca证书"><a class="header-link" href="#ios->=-10.3信任ca证书"></a>iOS >= 10.3信任CA证书</h3>
|
<h3 id="ios->=-10.3信任ca证书"><a class="header-link" href="#ios->=-10.3信任ca证书"></a>iOS >= 10.3信任CA证书</h3>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li>除了上述证书安装过程,还需要在 <em>设置->通用->证书信任设置</em> 中把AnyProxy证书的开关打开,否则safari将报错。</li>
|
<li>除了上述证书安装过程,还需要在 <em>设置->通用->关于本机->证书信任设置</em> 中把AnyProxy证书的开关打开,否则safari将报错。</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/hVWkXHrzHmOKOtCKGUWx.png" width="500" /></p>
|
||||||
<h3 id="配置ios/android系统代理"><a class="header-link" href="#配置ios/android系统代理"></a>配置iOS/Android系统代理</h3>
|
<h3 id="配置ios/android系统代理"><a class="header-link" href="#配置ios/android系统代理"></a>配置iOS/Android系统代理</h3>
|
||||||
@ -787,6 +791,38 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
|||||||
<li>Android HTTP代理配置</li>
|
<li>Android HTTP代理配置</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
||||||
|
<h2 id="faq-1"><a class="header-link" href="#faq-1"></a>FAQ</h2>
|
||||||
|
<h3 id="the-connection-is-not-private"><a class="header-link" href="#the-connection-is-not-private"></a>The connection is not private</h3>
|
||||||
|
<p>访问特定的HTTPS站点时,AnyProxy会提示该站点不是一个安全的网站,这通常是因为站点的证书设置不能被正确信任(比如,<a href="https://github.com/nodejs/node/issues/4175">Nodejs不读取系统配置,需要手动传入ca</a>)。</p>
|
||||||
|
<p>在评估了安全风险后,可以用以下方式绕过证书校验:</p>
|
||||||
|
<ul class="list">
|
||||||
|
<li><p>命令行启动</p>
|
||||||
|
<p>通过启动参数 <code>--ignore-unauthorized-ssl</code> 来忽略<strong>所有的</strong>证书认证的错误。</p>
|
||||||
|
<pre class="hljs"><code>anyproxy -i --ignore-unauthorized-ssl</code></pre></li>
|
||||||
|
<li><p>作为npm模块启动 </p>
|
||||||
|
<p>在构造AnyProxy实例的时候,传入参数<code>dangerouslyIgnoreUnauthorized:true</code>, 如下:</p>
|
||||||
|
<pre class="hljs"><code> <span class="hljs-keyword">const</span> options = {
|
||||||
|
...,
|
||||||
|
<span class="hljs-attr">dangerouslyIgnoreUnauthorized</span>: <span class="hljs-literal">true</span> <span class="hljs-comment">// 请注意这个配置对AnyProxy所有请求都生效</span>
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="hljs-keyword">const</span> anyproxyIns = <span class="hljs-keyword">new</span> AnyProxy.ProxyCore(options);
|
||||||
|
anyproxyIns.start();</code></pre></li>
|
||||||
|
<li><p>通过自定义的Rule来修改 </p>
|
||||||
|
<p>我们自然也可以借助自定义的Rule来对特定请求配置<code>rejectUnauthorized</code>。</p>
|
||||||
|
<pre class="hljs"><code><span class="hljs-built_in">module</span>.exports = {
|
||||||
|
*beforeSendRequest(requestDetail) {
|
||||||
|
<span class="hljs-keyword">if</span> (requestDetail.url.indexOf(<span class="hljs-string">'https://the-site-you-know.com'</span>) === <span class="hljs-number">0</span>) {
|
||||||
|
<span class="hljs-keyword">const</span> newRequestOptions = requestDetail.requestOptions;
|
||||||
|
<span class="hljs-comment">// 设置属性 rejectUnauthorized 为 false</span>
|
||||||
|
newRequestOptions.rejectUnauthorized = <span class="hljs-literal">false</span>;
|
||||||
|
<span class="hljs-keyword">return</span> {
|
||||||
|
<span class="hljs-attr">requestOptions</span>: newRequestOptions
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};</code></pre></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
34
en.html
34
en.html
@ -74,6 +74,8 @@
|
|||||||
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios">trust root CA in iOS</a></li>
|
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios">trust root CA in iOS</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios->=-10.3">trust root CA in iOS >= 10.3</a></li>
|
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios->=-10.3">trust root CA in iOS >= 10.3</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#config-ios/android-proxy-server">config iOS/Android proxy server</a></li>
|
<li class="sidebar-header-3"><a href="#config-ios/android-proxy-server">config iOS/Android proxy server</a></li>
|
||||||
|
<li class="sidebar-header-2"><a href="#faq-1">FAQ</a></li>
|
||||||
|
<li class="sidebar-header-3"><a href="#the-connection-is-not-private">The connection is not private</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -99,6 +101,8 @@
|
|||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
||||||
<h2 id="quick-start"><a class="header-link" href="#quick-start"></a>Quick start</h2>
|
<h2 id="quick-start"><a class="header-link" href="#quick-start"></a>Quick start</h2>
|
||||||
<h3 id="install"><a class="header-link" href="#install"></a>install</h3>
|
<h3 id="install"><a class="header-link" href="#install"></a>install</h3>
|
||||||
|
<p>To Debian and Ubuntu users, you may need to install <code>nodejs-legacy</code> at the same time</p>
|
||||||
|
<pre class="hljs"><code>sudo apg-get install nodejs-legacy</code></pre><p>Then install the AnyProxy</p>
|
||||||
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment"># 4.x is in beta now</span></code></pre><h3 id="launch"><a class="header-link" href="#launch"></a>launch</h3>
|
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment"># 4.x is in beta now</span></code></pre><h3 id="launch"><a class="header-link" href="#launch"></a>launch</h3>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li>start AnyProxy in command line, with default port 8001</li>
|
<li>start AnyProxy in command line, with default port 8001</li>
|
||||||
@ -782,6 +786,36 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
|||||||
<li>Android</li>
|
<li>Android</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
||||||
|
<h2 id="faq-1"><a class="header-link" href="#faq-1"></a>FAQ</h2>
|
||||||
|
<h3 id="the-connection-is-not-private"><a class="header-link" href="#the-connection-is-not-private"></a>The connection is not private</h3>
|
||||||
|
<p>AnyProxy will propmt this message when the certificate of the site you're visiting is not issued by a trusted CA.(e.g. <a href="https://github.com/nodejs/node/issues/4175">Node uses an hardcoded list of certificate authorities</a>)</p>
|
||||||
|
<p>You could ignore this kind of error at your own risk. The following is a how-to guide.</p>
|
||||||
|
<ul class="list">
|
||||||
|
<li><p>If you run AnyProxy by command line<br>Pass in the option <code>--ignore-unauthorized-ssl</code> to ignore <strong>all</strong> the certificate errors.</p>
|
||||||
|
<pre class="hljs"><code>anyproxy -i --ignore-unauthorized-ssl</code></pre></li>
|
||||||
|
<li><p>If you run AnyProxy as an npm module<br>Pass in the option <code>dangerouslyIgnoreUnauthorized:true</code>, like this:</p>
|
||||||
|
<pre class="hljs"><code><span class="hljs-keyword">const</span> options = {
|
||||||
|
...,
|
||||||
|
<span class="hljs-attr">dangerouslyIgnoreUnauthorized</span>: <span class="hljs-literal">true</span>
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="hljs-keyword">const</span> anyproxyIns = <span class="hljs-keyword">new</span> AnyProxy.ProxyCore(options); <span class="hljs-comment">// it would apply to all requests</span>
|
||||||
|
anyproxyIns.start();</code></pre></li>
|
||||||
|
<li><p>With the help of AnyProxy Rule</p>
|
||||||
|
<p>By pass in <code>rejectUnauthorized</code>, you could ignore SSL error in some specified request.</p>
|
||||||
|
<pre class="hljs"><code><span class="hljs-built_in">module</span>.exports = {
|
||||||
|
*beforeSendRequest(requestDetail) {
|
||||||
|
<span class="hljs-keyword">if</span> (requestDetail.url.indexOf(<span class="hljs-string">'https://the-site-you-know.com'</span>) === <span class="hljs-number">0</span>) {
|
||||||
|
<span class="hljs-keyword">const</span> newRequestOptions = requestDetail.requestOptions;
|
||||||
|
<span class="hljs-comment">// set rejectUnauthorized as false</span>
|
||||||
|
newRequestOptions.rejectUnauthorized = <span class="hljs-literal">false</span>;
|
||||||
|
<span class="hljs-keyword">return</span> {
|
||||||
|
<span class="hljs-attr">requestOptions</span>: newRequestOptions
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};</code></pre></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
34
index.html
34
index.html
@ -74,6 +74,8 @@
|
|||||||
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios">trust root CA in iOS</a></li>
|
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios">trust root CA in iOS</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios->=-10.3">trust root CA in iOS >= 10.3</a></li>
|
<li class="sidebar-header-3"><a href="#trust-root-ca-in-ios->=-10.3">trust root CA in iOS >= 10.3</a></li>
|
||||||
<li class="sidebar-header-3"><a href="#config-ios/android-proxy-server">config iOS/Android proxy server</a></li>
|
<li class="sidebar-header-3"><a href="#config-ios/android-proxy-server">config iOS/Android proxy server</a></li>
|
||||||
|
<li class="sidebar-header-2"><a href="#faq-1">FAQ</a></li>
|
||||||
|
<li class="sidebar-header-3"><a href="#the-connection-is-not-private">The connection is not private</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -99,6 +101,8 @@
|
|||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/SqVntpzmscXPbSzfcGcr.png" width="500" /></p>
|
||||||
<h2 id="quick-start"><a class="header-link" href="#quick-start"></a>Quick start</h2>
|
<h2 id="quick-start"><a class="header-link" href="#quick-start"></a>Quick start</h2>
|
||||||
<h3 id="install"><a class="header-link" href="#install"></a>install</h3>
|
<h3 id="install"><a class="header-link" href="#install"></a>install</h3>
|
||||||
|
<p>To Debian and Ubuntu users, you may need to install <code>nodejs-legacy</code> at the same time</p>
|
||||||
|
<pre class="hljs"><code>sudo apg-get install nodejs-legacy</code></pre><p>Then install the AnyProxy</p>
|
||||||
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment"># 4.x is in beta now</span></code></pre><h3 id="launch"><a class="header-link" href="#launch"></a>launch</h3>
|
<pre class="hljs"><code>npm install -g anyproxy@beta <span class="hljs-comment"># 4.x is in beta now</span></code></pre><h3 id="launch"><a class="header-link" href="#launch"></a>launch</h3>
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<li>start AnyProxy in command line, with default port 8001</li>
|
<li>start AnyProxy in command line, with default port 8001</li>
|
||||||
@ -782,6 +786,36 @@ AnyProxy.utils.systemProxyMgr.disableGlobalProxy();</code></pre></li>
|
|||||||
<li>Android</li>
|
<li>Android</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
<p class="img-container"><img src="https://zos.alipayobjects.com/rmsportal/YQtbQYVNuOszZGdAOauU.png" width="260" /></p>
|
||||||
|
<h2 id="faq-1"><a class="header-link" href="#faq-1"></a>FAQ</h2>
|
||||||
|
<h3 id="the-connection-is-not-private"><a class="header-link" href="#the-connection-is-not-private"></a>The connection is not private</h3>
|
||||||
|
<p>AnyProxy will propmt this message when the certificate of the site you're visiting is not issued by a trusted CA.(e.g. <a href="https://github.com/nodejs/node/issues/4175">Node uses an hardcoded list of certificate authorities</a>)</p>
|
||||||
|
<p>You could ignore this kind of error at your own risk. The following is a how-to guide.</p>
|
||||||
|
<ul class="list">
|
||||||
|
<li><p>If you run AnyProxy by command line<br>Pass in the option <code>--ignore-unauthorized-ssl</code> to ignore <strong>all</strong> the certificate errors.</p>
|
||||||
|
<pre class="hljs"><code>anyproxy -i --ignore-unauthorized-ssl</code></pre></li>
|
||||||
|
<li><p>If you run AnyProxy as an npm module<br>Pass in the option <code>dangerouslyIgnoreUnauthorized:true</code>, like this:</p>
|
||||||
|
<pre class="hljs"><code><span class="hljs-keyword">const</span> options = {
|
||||||
|
...,
|
||||||
|
<span class="hljs-attr">dangerouslyIgnoreUnauthorized</span>: <span class="hljs-literal">true</span>
|
||||||
|
};
|
||||||
|
|
||||||
|
<span class="hljs-keyword">const</span> anyproxyIns = <span class="hljs-keyword">new</span> AnyProxy.ProxyCore(options); <span class="hljs-comment">// it would apply to all requests</span>
|
||||||
|
anyproxyIns.start();</code></pre></li>
|
||||||
|
<li><p>With the help of AnyProxy Rule</p>
|
||||||
|
<p>By pass in <code>rejectUnauthorized</code>, you could ignore SSL error in some specified request.</p>
|
||||||
|
<pre class="hljs"><code><span class="hljs-built_in">module</span>.exports = {
|
||||||
|
*beforeSendRequest(requestDetail) {
|
||||||
|
<span class="hljs-keyword">if</span> (requestDetail.url.indexOf(<span class="hljs-string">'https://the-site-you-know.com'</span>) === <span class="hljs-number">0</span>) {
|
||||||
|
<span class="hljs-keyword">const</span> newRequestOptions = requestDetail.requestOptions;
|
||||||
|
<span class="hljs-comment">// set rejectUnauthorized as false</span>
|
||||||
|
newRequestOptions.rejectUnauthorized = <span class="hljs-literal">false</span>;
|
||||||
|
<span class="hljs-keyword">return</span> {
|
||||||
|
<span class="hljs-attr">requestOptions</span>: newRequestOptions
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};</code></pre></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user