设置代理? [英] setting the proxy?

查看:163
本文介绍了设置代理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个broswer类型的应用程序我想设置代理服务器只为这个浏览器

我试图用这个code修改全局代理,但它不能正常工作

  System.getProperties()把(http.proxyHost,someProxyURL);
System.getProperties()把(把http.proxyPort,someProxyPort);
。System.getProperties()把(http.proxyUser,someUserName);
System.getProperties()把(http.proxyPassword,somePassword);
。System.getProperties()把(http.proxySet,真);

所以,我看着的ProxySelector 类,我真的不知道如何设置代理为我布劳尔

我知道有一个隐藏的类的ProxySelector com.android.settings / .ProxySelector

但我必须手动输入的代理。

有什么办法,这样我可以配置代理服务器只为mybrowser(只是一个网页视图)??

请帮助。提前致谢!!!


解决方案

  System.getProperties()把(http.proxyUser,someUserName);
System.getProperties()把(http.proxyPassword,somePassword);

在JDK这些不要的工作,只有在Apache HTTP客户端。

  System.getProperties()把(http.proxySet,真)。

这是一个城市的神话。它出现在一些早期的Java书籍,但从未做过的事情JDK。这是解散HotJavaBean浏览器C的遗物。 1998年。

I am making a broswer type app i want to set the proxy only for this browser

I tried to modify global proxy by using this code but it does not work

System.getProperties().put("http.proxyHost", "someProxyURL");
System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");
System.getProperties().put("http.proxySet", "true");

So I looked at proxySelector class and I really don't understand how to set the proxy for my brower

I know there is a hidden class in ProxySelector in com.android.settings/.ProxySelector

But I have to manually entered the proxy.

Is there any way so that i can configure proxy only for mybrowser(Just a Webview) ??

Please Help. Thanks in Advance!!!

解决方案

System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");

These dont' work in the JDK, only in the Apache HTTP client.

System.getProperties().put("http.proxySet", "true");

This is an urban myth. It appears in some early Java books but has never done anything in the JDK. It is a relic of the defunct HotJavaBean browser c. 1998.

这篇关于设置代理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆