我如何创建一个代理服务器来监控我的 android 中的用户..
我尝试使用此代码创建代理服务器..但是没有创建..我做错了什么请说明..
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);
}
最佳答案
通过这种方式,您可以为应用程序的 HttpClient 配置代理。 最新版本的 Android 根本不支持系统范围的代理。检查此以获取更多详细信息:How to set system wide proxy in ICS
关于Android:创建代理服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14973980/