Class FirefoxProxySelector

java.lang.Object
java.net.ProxySelector
net.sourceforge.jnlp.proxy.JNLPProxySelector
net.sourceforge.jnlp.proxy.browser.FirefoxProxySelector

public class FirefoxProxySelector extends JNLPProxySelector
A ProxySelector which can read proxy settings from a browser's configuration and use that.
See Also:
  • Field Details

    • LOG

      private static final Logger LOG
    • firefoxProxyType

      private FirefoxProxyType firefoxProxyType
    • browserAutoConfigUrl

      private URL browserAutoConfigUrl
    • browserUseSameProxy

      private Boolean browserUseSameProxy
      Whether the http proxy should be used for http, https, ftp and socket protocols
    • browserHttpProxyHost

      private String browserHttpProxyHost
    • browserHttpProxyPort

      private int browserHttpProxyPort
    • browserHttpsProxyHost

      private String browserHttpsProxyHost
    • browserHttpsProxyPort

      private int browserHttpsProxyPort
    • browserFtpProxyHost

      private String browserFtpProxyHost
    • browserFtpProxyPort

      private int browserFtpProxyPort
    • browserSocks4ProxyHost

      private String browserSocks4ProxyHost
    • browserSocks4ProxyPort

      private int browserSocks4ProxyPort
    • browserProxyAutoConfig

      private PacEvaluator browserProxyAutoConfig
  • Constructor Details

  • Method Details

    • initFromBrowserConfig

      private void initFromBrowserConfig(PreferencesParser preferenceParser) throws IOException
      Initialize configuration by reading preferences from the browser (firefox)
      Throws:
      IOException
    • stringToPort

      private int stringToPort(String string)
      Returns port inside a string. Unlike Integer.valueOf(String), it will not throw exceptions.
      Parameters:
      string - the string containing the integer to parse
      Returns:
      the port inside the string, or Integer.MIN_VALUE
    • getFromBrowser

      public List<Proxy> getFromBrowser(URI uri)

      The main entry point for FirefoxProxySelector. Based on the browser settings, determines proxy information for a given URI.

      The appropriate proxy may be determined by reading static information from the browser's preferences file, or it may be computed dynamically, by, for example, running javascript code.

      Specified by:
      getFromBrowser in class JNLPProxySelector
      Parameters:
      uri - the uri to get proxies for
      Returns:
      a list of proxies
    • getFromBrowserPAC

      private List<Proxy> getFromBrowserPAC(URI uri)
      Get an appropriate proxy for a given URI using a PAC specified in the browser.
    • getFromBrowserConfiguration

      private List<Proxy> getFromBrowserConfiguration(URI uri)
      Get an appropriate proxy for the given URI using static information from the browser's preferences file.