Platforms to show: All Mac Windows Linux Cross-Platform

Back to WinHTTPClientMBS class.

WinHTTPClientMBS.Close as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Win Plugin 14.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Closes the session.

WinHTTPClientMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Win Plugin 14.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
The constructor.

WinHTTPClientMBS.GetProxyForUrl(URL as string, AutoProxyOptions as WinHTTPClientAutoProxyOptionsMBS, byref ProxyInfo as WinHTTPClientProxyInfoMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Win Plugin 14.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Retrieves the proxy data for the specified URL.

Url: Contains the URL of the HTTP request that the application is preparing to send.
AutoProxyOptions: Specifies the auto-proxy options to use.
ProxyInfo: Receives the proxy setting.

If the function succeeds, the function returns true.
If the function fails, it returns false. Lasterror is set.

This function implements the Web Proxy Auto-Discovery (WPAD) protocol for automatically configuring the proxy settings for an HTTP request. The WPAD protocol downloads a Proxy Auto-Configuration (PAC) file, which is a script that identifies the proxy server to use for a given target URL. PAC files are typically deployed by the IT department within a corporate network environment. The URL of the PAC file can either be specified explicitly or GetProxyForUrl can be instructed to automatically discover the location of the PAC file on the local network.

GetProxyForUrl supports only ECMAScript-based PAC files.
GetProxyForUrl must be called on a per-URL basis, because the PAC file can return a different proxy server for different URLs. This is useful because the PAC file enables an IT department to implement proxy server load balancing by mapping (hashing) the target URL (specified by the lpcwszUrl parameter) to a certain proxy in a proxy server array.
GetProxyForUrl caches the autoproxy URL and the autoproxy script when auto-discovery is specified in the dwFlags member of the pAutoProxyOptions structure. For more information, see Autoproxy Cache.

see also
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384097(v=vs.85).aspx

Some examples using this method:

WinHTTPClientMBS.Open(UserAgent as string, AccessType as Integer, ProxyName as string = "", ProxyByPass as string = "") as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Network MBS Win Plugin 14.1 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Initializes an application's use of the WinINet functions.

lUserAgent: Specifies the name of the application or entity calling the WinINet functions. This name is used as the user agent in the HTTP protocol.
AccessType: Type of access required. This parameter can be one of the following values.
ValueMeaning
INTERNET_OPEN_TYPE_DIRECTResolves all host names locally.
INTERNET_OPEN_TYPE_PRECONFIGRetrieves the proxy or direct configuration from the registry.
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXYRetrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft JScript or Internet Setup (INS) file.
INTERNET_OPEN_TYPE_PROXYPasses requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy. In this case, the function uses INTERNET_OPEN_TYPE_DIRECT.

ProxyName: String that specifies the name of the proxy server(s) to use when proxy access is specified by setting dwAccessType to INTERNET_OPEN_TYPE_PROXY. Do not use an empty string, because InternetOpen will use it as the proxy name. The WinINet functions recognize only CERN type proxies (HTTP only) and the TIS FTP gateway (FTP only). If Microsoft Internet Explorer is installed, these functions also support SOCKS proxies. FTP requests can be made through a CERN type proxy either by changing them to an HTTP request or by using InternetOpenUrl. If dwAccessType is not set to INTERNET_OPEN_TYPE_PROXY, this parameter is ignored and should be NULL. For more information about listing proxy servers, see the Listing Proxy Servers section of Enabling Internet Functionality.
ProxyBypass: Specifies an optional list of host names or IP addresses, or both, that should not be routed through the proxy when dwAccessType is set to INTERNET_OPEN_TYPE_PROXY. The list can contain wildcards. Do not use an empty string, because InternetOpen will use it as the proxy bypass list. If this parameter specifies the "<local>" macro, the function bypasses the proxy for any host name that does not contain a period.
By default, WinINet will bypass the proxy for requests that use the host names "localhost", "loopback", "127.0.0.1", or "[::1]". This behavior exists because a remote proxy server typically will not resolve these addresses properly.
Internet Explorer 9: You can remove the local computer from the proxy bypass list using the "<-loopback>" macro.
If dwAccessType is not set to INTERNET_OPEN_TYPE_PROXY, this parameter is ignored and should be NULL.
Flags: Options. This parameter can be a combination of the following values.
ValueMeaning
INTERNET_FLAG_ASYNCMakes only asynchronous requests on handles descended from the handle returned from this function.
INTERNET_FLAG_FROM_CACHEDoes not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned.
INTERNET_FLAG_OFFLINEIdentical to INTERNET_FLAG_FROM_CACHE. Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned.

Returns a valid handle that the application passes to subsequent WinINet functions. If Open fails, it returns false. To retrieve a specific error message, call GetLastError.

see also
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385096(v=vs.85).aspx

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...