java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.httpclient.contrib.proxy.PluginProxyUtil

public class PluginProxyUtil extends Object
A utility class that gives applets the ability to detect proxy host settings. This was adapted from a post from Chris Forster on 20030227 to a Sun Java forum here: http://forum.java.sun.com/thread.jspa?threadID=364342&tstart=120 The algorithm - which relies on Sun java plugin internal classes in some cases - was maintained, but the following changes were made: 1. Logging was used to allow control of debug type messages. 2. Reflection is used instead of direct references to Sun internal classes to avoid the need to have these classes in the CLASSPATH to compile. 3. Removed the use of global variables to allow this class to be used in a multi-threaded environment. 4. Add the use of exception to indicate to the caller when proxy detection failed as opposed to when no proxy is configured.

DISCLAIMER: HttpClient developers DO NOT actively support this component. The component is provided as a reference material, which may be inappropriate for use without additional customization.

  • Constructor Details

    • PluginProxyUtil

      public PluginProxyUtil()
  • Method Details

    • detectProxy

      public static ProxyHost detectProxy(URL sampleURL) throws ProxyDetectionException
      Returns the Proxy Host information using settings from the java plugin.
      Parameters:
      sampleURL - the url target for which proxy host information is required
      Returns:
      the proxy host info (name and port) or null if a direct connection is allowed to the target url.
      Throws:
      ProxyDetectionException - if detection failed