Class WinProxySearchStrategy
- java.lang.Object
-
- com.github.markusbernhardt.proxy.search.desktop.win.CommonWindowsSearchStrategy
-
- com.github.markusbernhardt.proxy.search.desktop.win.WinProxySearchStrategy
-
- All Implemented Interfaces:
ProxySearchStrategy
public class WinProxySearchStrategy extends CommonWindowsSearchStrategy
Extracts the proxy settings from the windows registry. This will read the windows system proxy settings.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intWINHTTP_ACCESS_TYPE_DEFAULT_PROXYResolves all host names directly without a proxy.(package private) static intWINHTTP_ACCESS_TYPE_NAMED_PROXYPasses requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy.(package private) static intWINHTTP_ACCESS_TYPE_NO_PROXYRetrieves the static proxy or direct configuration from the registry.
-
Constructor Summary
Constructors Constructor Description WinProxySearchStrategy()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.net.ProxySelectorcreateFixedProxySelector(WinProxyConfig winProxyConfig)Parses the proxy settings into an ProxySelector.java.lang.StringgetName()Gets the printable name of the search strategy.java.net.ProxySelectorgetProxySelector()getProxySelectorWinProxyConfigreadWindowsProxyConfig()-
Methods inherited from class com.github.markusbernhardt.proxy.search.desktop.win.CommonWindowsSearchStrategy
buildProtocolDispatchSelector, parseProxyList, setByPassListOnSelector
-
-
-
-
Field Detail
-
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
static final int WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
Resolves all host names directly without a proxy.- See Also:
- Constant Field Values
-
WINHTTP_ACCESS_TYPE_NO_PROXY
static final int WINHTTP_ACCESS_TYPE_NO_PROXY
Retrieves the static proxy or direct configuration from the registry. WINHTTP_ACCESS_TYPE_DEFAULT_PROXY does not inherit browser proxy settings. WinHTTP does not share any proxy settings with Internet Explorer.The WinHTTP proxy configuration is set by one of these mechanisms.
- The proxycfg.exe utility on Windows XP and Windows Server 2003 or earlier.
- The netsh.exe utility on Windows Vista and Windows Server 2008 or later.
- WinHttpSetDefaultProxyConfiguration on all platforms.
- See Also:
- Constant Field Values
-
WINHTTP_ACCESS_TYPE_NAMED_PROXY
static final int WINHTTP_ACCESS_TYPE_NAMED_PROXY
Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. In this case, this function uses WINHTTP_ACCESS_TYPE_NAMED_PROXY.- See Also:
- Constant Field Values
-
-
Method Detail
-
getProxySelector
public java.net.ProxySelector getProxySelector() throws ProxyExceptiongetProxySelector- Returns:
- a ProxySelector, null if none is found.
- Throws:
ProxyException- on error- See Also:
ProxySearchStrategy.getProxySelector()
-
getName
public java.lang.String getName()
Gets the printable name of the search strategy.- Returns:
- the printable name of the search strategy
-
readWindowsProxyConfig
public WinProxyConfig readWindowsProxyConfig()
-
createFixedProxySelector
private java.net.ProxySelector createFixedProxySelector(WinProxyConfig winProxyConfig) throws ProxyException
Parses the proxy settings into an ProxySelector.- Parameters:
winProxySettings- the settings to use.- Returns:
- a ProxySelector, null if no settings are set.
- Throws:
ProxyException- on error.
-
-