[英]Android:create a proxy server
How can i create a proxy server to monitor my users in my android.. 我如何创建代理服务器来监视我的Android用户。
I tried to create proxy server using this code ..But that not getting created..Did i do anything wrong in that please state.. 我试图使用此代码创建代理服务器..但未创建..在此情况下,我没有做任何错..
public void setProxy(DefaultHttpClient httpclient) {
final String PROXY_IP = "127.0.0.1";
final int PROXY_PORT = 8080;
httpclient.getCredentialsProvider().setCredentials(
new AuthScope(PROXY_IP, PROXY_PORT),
new UsernamePasswordCredentials(
"root", "password"));
HttpHost proxy = new HttpHost(PROXY_IP, PROXY_PORT);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
proxy);
}
In this way you are configuring proxy for your application's HttpClient. 通过这种方式,您可以为应用程序的HttpClient配置代理。 Recent versions of Android do not support system-wide proxy at all.
最新版本的Android根本不支持系统范围的代理。 Check this for some more details: How to set system wide proxy in ICS
请检查此以获取更多详细信息: 如何在ICS中设置系统范围的代理
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.