Class PacProxySelector
java.lang.Object
java.net.ProxySelector
com.github.markusbernhardt.proxy.selector.pac.PacProxySelector
- Direct Known Subclasses:
SafePacProxySelector
ProxySelector that will use a PAC script to find a proxy for a given URI.
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ProxybuildProxyFromPacResult(String pacResult) The proxy evaluator will return a proxy string.voidconnectFailed(URI uri, SocketAddress sa, IOException ioe) connectFailedstatic booleanChecks if the selector is currently enabled.selectstatic voidsetEnabled(boolean enable) Can be used to enable / disable the proxy selector.Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
Constructor Details
-
PacProxySelector
Constructor- Parameters:
pacSource- the source for the PAC file.
-
-
Method Details
-
setEnabled
public static void setEnabled(boolean enable) Can be used to enable / disable the proxy selector. If disabled it will return DIRECT for all urls.- Parameters:
enable- the new status to set.
-
isEnabled
public static boolean isEnabled()Checks if the selector is currently enabled.- Returns:
- true if enabled else false.
-
connectFailed
connectFailed- Specified by:
connectFailedin classProxySelector- See Also:
-
select
select- Specified by:
selectin classProxySelector- See Also:
-
buildProxyFromPacResult
The proxy evaluator will return a proxy string. This method will take this string and build a matchingProxyfor it.- Parameters:
pacResult- the result from the PAC parser.- Returns:
- a Proxy
-