- 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();
- }
-
- 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;
+ 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();