Class WinHttpHelpers
- java.lang.Object
-
- com.github.markusbernhardt.proxy.jna.win.WinHttpHelpers
-
public class WinHttpHelpers extends java.lang.Object
Static helper methods for WindowsWinHttp
functions.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ERROR_WINHTTP_AUTODETECTION_FAILED
Returned if WinHTTP was unable to discover the URL of the Proxy Auto-Configuration (PAC) file using the WPAD method.static WinHttp
WINHTTP_INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
WinHttpHelpers()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
detectAutoProxyConfigUrl(com.sun.jna.platform.win32.WinDef.DWORD dwAutoDetectFlags)
Finds the URL for the Proxy Auto-Configuration (PAC) file using WPAD.private java.lang.String
sanitizeUrl(java.lang.String urlStr)
-
-
-
Field Detail
-
WINHTTP_INSTANCE
public static final WinHttp WINHTTP_INSTANCE
-
ERROR_WINHTTP_AUTODETECTION_FAILED
private static final int ERROR_WINHTTP_AUTODETECTION_FAILED
Returned if WinHTTP was unable to discover the URL of the Proxy Auto-Configuration (PAC) file using the WPAD method.- See Also:
- Constant Field Values
-
-
Method Detail
-
detectAutoProxyConfigUrl
public static java.lang.String detectAutoProxyConfigUrl(com.sun.jna.platform.win32.WinDef.DWORD dwAutoDetectFlags)
Finds the URL for the Proxy Auto-Configuration (PAC) file using WPAD. This is merely a wrapper aroundWinHttpDetectAutoProxyConfigUrl
This method is blocking and may take some time to execute.
- Parameters:
dwAutoDetectFlags
- flags for auto detection- Returns:
- the url of the PAC file or
null
if it cannot be located using WPAD method.
-
sanitizeUrl
private java.lang.String sanitizeUrl(java.lang.String urlStr)
-
-