Class PacProxySelector
- java.lang.Object
-
- java.net.ProxySelector
-
- com.github.markusbernhardt.proxy.selector.pac.PacProxySelector
-
public class PacProxySelector extends ProxySelector
ProxySelector that will use a PAC script to find an proxy for a given URI.- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
-
Constructor Summary
Constructors Constructor Description PacProxySelector(PacScriptSource pacSource)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnectFailed(URI uri, SocketAddress sa, IOException ioe)connectFailedstatic booleanisEnabled()Checks if the selector is currently enabled.List<Proxy>select(URI uri)selectstatic voidsetEnabled(boolean enable)Can be used to enable / disable the proxy selector.-
Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
-
-
-
Constructor Detail
-
PacProxySelector
public PacProxySelector(PacScriptSource pacSource)
Constructor- Parameters:
pacSource- the source for the PAC file.
-
-
Method Detail
-
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
public void connectFailed(URI uri, SocketAddress sa, IOException ioe)
connectFailed- Specified by:
connectFailedin classProxySelector- See Also:
ProxySelector.connectFailed(java.net.URI, java.net.SocketAddress, java.io.IOException)
-
select
public List<Proxy> select(URI uri)
select- Specified by:
selectin classProxySelector- See Also:
ProxySelector.select(java.net.URI)
-
-