Class FirefoxProxySelector
java.lang.Object
java.net.ProxySelector
net.sourceforge.jnlp.proxy.JNLPProxySelector
net.sourceforge.jnlp.proxy.browser.FirefoxProxySelector
A ProxySelector which can read proxy settings from a browser's
configuration and use that.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate URLprivate Stringprivate intprivate Stringprivate intprivate Stringprivate intprivate PacEvaluatorprivate Stringprivate intprivate BooleanWhether the http proxy should be used for http, https, ftp and socket protocolsprivate FirefoxProxyTypeprivate static final Logger -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of this class, reading configuration from the browserFirefoxProxySelector(DeploymentConfiguration config, PreferencesParser preferenceParser) visible for testing purposes -
Method Summary
Modifier and TypeMethodDescriptiongetFromBrowser(URI uri) The main entry point forFirefoxProxySelector.Get an appropriate proxy for the given URI using static information from the browser's preferences file.getFromBrowserPAC(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(String string) Returns port inside a string.Methods inherited from class JNLPProxySelector
connectFailed, getFromArguments, selectMethods inherited from class ProxySelector
getDefault, of, setDefault
-
Field Details
-
LOG
-
firefoxProxyType
-
browserAutoConfigUrl
-
browserUseSameProxy
Whether the http proxy should be used for http, https, ftp and socket protocols -
browserHttpProxyHost
-
browserHttpProxyPort
private int browserHttpProxyPort -
browserHttpsProxyHost
-
browserHttpsProxyPort
private int browserHttpsProxyPort -
browserFtpProxyHost
-
browserFtpProxyPort
private int browserFtpProxyPort -
browserSocks4ProxyHost
-
browserSocks4ProxyPort
private int browserSocks4ProxyPort -
browserProxyAutoConfig
-
-
Constructor Details
-
FirefoxProxySelector
Create a new instance of this class, reading configuration from the browser -
FirefoxProxySelector
FirefoxProxySelector(DeploymentConfiguration config, PreferencesParser preferenceParser) visible for testing purposes
-
-
Method Details
-
initFromBrowserConfig
Initialize configuration by reading preferences from the browser (firefox)- Throws:
IOException
-
stringToPort
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
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
-
getFromBrowserConfiguration
-