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:
JNLPProxySelector
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URLbrowserAutoConfigUrlprivate java.lang.StringbrowserFtpProxyHostprivate intbrowserFtpProxyPortprivate java.lang.StringbrowserHttpProxyHostprivate intbrowserHttpProxyPortprivate java.lang.StringbrowserHttpsProxyHostprivate intbrowserHttpsProxyPortprivate PacEvaluatorbrowserProxyAutoConfigprivate java.lang.StringbrowserSocks4ProxyHostprivate intbrowserSocks4ProxyPortprivate java.lang.BooleanbrowserUseSameProxyWhether the http proxy should be used for http, https, ftp and socket protocolsprivate FirefoxProxyTypefirefoxProxyTypeprivate static LoggerLOG
-
Constructor Summary
Constructors Constructor Description FirefoxProxySelector(DeploymentConfiguration config)Create a new instance of this class, reading configuration from the browserFirefoxProxySelector(DeploymentConfiguration config, PreferencesParser preferenceParser)visible for testing purposes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.net.Proxy>getFromBrowser(java.net.URI uri)The main entry point forFirefoxProxySelector.private java.util.List<java.net.Proxy>getFromBrowserConfiguration(java.net.URI uri)Get an appropriate proxy for the given URI using static information from the browser's preferences file.private java.util.List<java.net.Proxy>getFromBrowserPAC(java.net.URI uri)Get an appropriate proxy for a given URI using a PAC specified in the browser.private voidinitFromBrowserConfig(PreferencesParser preferenceParser)Initialize configuration by reading preferences from the browser (firefox)private intstringToPort(java.lang.String string)Returns port inside a string.-
Methods inherited from class net.sourceforge.jnlp.proxy.JNLPProxySelector
connectFailed, getFromArguments, select
-
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
firefoxProxyType
private FirefoxProxyType firefoxProxyType
-
browserAutoConfigUrl
private java.net.URL browserAutoConfigUrl
-
browserUseSameProxy
private java.lang.Boolean browserUseSameProxy
Whether the http proxy should be used for http, https, ftp and socket protocols
-
browserHttpProxyHost
private java.lang.String browserHttpProxyHost
-
browserHttpProxyPort
private int browserHttpProxyPort
-
browserHttpsProxyHost
private java.lang.String browserHttpsProxyHost
-
browserHttpsProxyPort
private int browserHttpsProxyPort
-
browserFtpProxyHost
private java.lang.String browserFtpProxyHost
-
browserFtpProxyPort
private int browserFtpProxyPort
-
browserSocks4ProxyHost
private java.lang.String browserSocks4ProxyHost
-
browserSocks4ProxyPort
private int browserSocks4ProxyPort
-
browserProxyAutoConfig
private PacEvaluator browserProxyAutoConfig
-
-
Constructor Detail
-
FirefoxProxySelector
public FirefoxProxySelector(DeploymentConfiguration config)
Create a new instance of this class, reading configuration from the browser
-
FirefoxProxySelector
FirefoxProxySelector(DeploymentConfiguration config, PreferencesParser preferenceParser)
visible for testing purposes
-
-
Method Detail
-
initFromBrowserConfig
private void initFromBrowserConfig(PreferencesParser preferenceParser) throws java.io.IOException
Initialize configuration by reading preferences from the browser (firefox)- Throws:
java.io.IOException
-
stringToPort
private int stringToPort(java.lang.String string)
Returns port inside a string. UnlikeInteger.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 java.util.List<java.net.Proxy> getFromBrowser(java.net.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:
getFromBrowserin classJNLPProxySelector- Parameters:
uri- the uri to get proxies for- Returns:
- a list of proxies
-
getFromBrowserPAC
private java.util.List<java.net.Proxy> getFromBrowserPAC(java.net.URI uri)
Get an appropriate proxy for a given URI using a PAC specified in the browser.
-
getFromBrowserConfiguration
private java.util.List<java.net.Proxy> getFromBrowserConfiguration(java.net.URI uri)
Get an appropriate proxy for the given URI using static information from the browser's preferences file.
-
-