Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
com/en-
us/library/windows/desktop/aa384098(v=vs.85).aspx ] currently we use
WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY (works on 8.1 & above)
=======================================================================
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY is the flag which doesn’t inherit browser proxy settings &
which is why prob. it worked for all 3 combos (Basic, Basic+PAC, Basic+WPAD) even when the
credentials were not present.
======================================================================
If we use WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*
lProxyInfo)
Where WINHTTP_CURRENT_USER_IE_PROXY_CONFIG is
typedef struct {
BOOL fAutoDetect; => if true, should imply WPAD conf.(Web Proxy Auto-Discovery) : CASE 3
LPWSTR lpszAutoConfigUrl; => if not null & fAutoDetect is false implies PAC conf. & this string has URL
for PAC file : CASE 2
LPWSTR lpszProxy; => If both above are not set, implies simple proxy & proxy URL is this : CASE 1
LPWSTR lpszProxyBypass; // bypass URLs
} WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
=====================================================================
CASE :1
=====================================================================
CASE :3
If WPAD conf (fAutoDetect is true) we can use WinHttpGetProxyForUrl to retrieve the proxy for the
request as mentioned here (https://msdn.microsoft.com/en-
us/library/windows/desktop/aa384075(v=vs.85).aspx) in form of WINHTTP_PROXY_INFO .
struct WINHTTP_PROXY_INFO {
DWORD dwAccessType;
LPWSTR lpszProxy;
LPWSTR lpszProxyBypass;
};
As WinHttpGetProxyForUrl uses WINHTTP_AUTOPROXY_OPTIONS which we can set as per our req.
(https://msdn.microsoft.com/en-us/library/windows/desktop/aa384123(v=vs.85).aspx) and
[ Note: WPAD we set via this registry=> HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet ->
services -> Tcpip -> Parameters]
=======================================================================
CASE :2
If PAC (lpszAutoConfigUrl is set & AutoDetect False) we should try to get proxy URL using this structure
WINHTTP_AUTOPROXY_OPTIONS config as input for WinHttpGetProxyForUrl / WinHttpGetProxyForUrl
Ex & we get output WINHTTP_PROXY_INFO which has proxy config details.
==================================================================
==================================================================