- /** this is done with reflection in case a new version of the plugin comes out that doesn't let us pull the sun.plugin.* trick */
- protected synchronized org.ibex.HTTP.Proxy _detectProxy() {
- return (org.ibex.HTTP.Proxy)java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
- public Object run() {
- try {
- org.ibex.HTTP.Proxy pi = new org.ibex.HTTP.Proxy();
-
- Class PluginProxyHandler = Class.forName("sun.plugin.protocol.PluginProxyHandler");
- Method getDefaultProxyHandler = PluginProxyHandler.getMethod("getDefaultProxyHandler", new Class[] { });
- Object proxyHandler = getDefaultProxyHandler.invoke(null, new Object[] { });
-
- Class ProxyHandler = Class.forName("sun.plugin.protocol.ProxyHandler");
- Method getProxyInfo = ProxyHandler.getMethod("getProxyInfo", new Class[] { URL.class });
- Object proxyInfo = getProxyInfo.invoke(proxyHandler, new Object[] { new URL("http://www.ibex.org") });
-
- Class ProxyInfo = Class.forName("sun.plugin.protocol.ProxyInfo");
-
- if (((Boolean)ProxyInfo.getMethod("isSocksUsed", new Class[] { }).invoke(proxyInfo, new Object[] { })).booleanValue()) {
- pi.socksProxyHost =
- (String)ProxyInfo.getMethod("getSocksProxy", new Class[] { }).invoke(proxyInfo, new Object[] { });
- pi.socksProxyPort =
- ((Integer)ProxyInfo.getMethod("getSocksPort", new Class[] { }).invoke(proxyInfo, new Object[] { })).intValue();
- }
-
- if (((Boolean)ProxyInfo.getMethod("isProxyUsed", new Class[] { }).invoke(proxyInfo, new Object[] { })).booleanValue()) {
- pi.httpProxyHost =
- (String)ProxyInfo.getMethod("getProxy", new Class[] { }).invoke(proxyInfo, new Object[] { });
- pi.httpProxyPort =
- ((Integer)ProxyInfo.getMethod("getPort", new Class[] { }).invoke(proxyInfo, new Object[] { })).intValue();
- }
-
- if (pi.httpProxyHost != null || pi.socksProxyHost != null) return pi;
- else return null;
-
- } catch (Throwable e) {
- if (Log.on) Log.info(this, "No proxy information found in Java Plugin classes");
- return null;
+ /** this is done with reflection in case a new plugin comes out that doesn't let us pull the sun.plugin.* trick */
+ protected synchronized org.ibex.net.HTTP.Proxy _detectProxy() {
+ return (org.ibex.net.HTTP.Proxy)java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
+ public Object run() { try {
+ org.ibex.net.HTTP.Proxy pi = new org.ibex.net.HTTP.Proxy();
+
+ Class PluginProxyHandler = Class.forName("sun.plugin.protocol.PluginProxyHandler");
+ Method getDefaultProxyHandler = PluginProxyHandler.getMethod("getDefaultProxyHandler", new Class[] { });
+ Object proxyHandler = getDefaultProxyHandler.invoke(null, new Object[] { });
+
+ Class ProxyHandler = Class.forName("sun.plugin.protocol.ProxyHandler");
+ Method getProxyInfo = ProxyHandler.getMethod("getProxyInfo", new Class[] { URL.class });
+ Object proxyInfo = getProxyInfo.invoke(proxyHandler, new Object[] { new URL("http://www.ibex.org") });
+
+ Class ProxyInfo = Class.forName("sun.plugin.protocol.ProxyInfo");
+
+ if (((Boolean)ProxyInfo.getMethod("isSocksUsed",
+ new Class[] { }).invoke(proxyInfo, new Object[] { })).booleanValue()) {
+ pi.socksProxyHost =
+ (String)ProxyInfo.getMethod("getSocksProxy",
+ new Class[] { }).invoke(proxyInfo, new Object[] { });
+ pi.socksProxyPort =
+ ((Integer)ProxyInfo.getMethod("getSocksPort",
+ new Class[] { }).invoke(proxyInfo, new Object[] { })).intValue();