This illustrates the use of the Microsoft Windows HTTP Services (WinHTTP) Proxy Configuration Device ProxyCfg.exe.
There are two ways to get HTTP and HTTPS (Hypertext Secure Transfer Protocol) servers through a proxy server that spawns Microsoft Windows HTTP Services (WinHTTP). First, you can specify the proxy settings as you would in your WinHTTP application. Second, you can specify the default proxy settings, which are initially obtained from outside your application, using the proxy server configuration utility located in the %windir%\system32 directory.
You can programmatically set a proxy for private information in your application in addition to the script. If you are writing any type of application that uses the WinHTTP API, use one of the following two options to change your proxy settings.
Use any WinHttpOpen function. Specify the access type in each parameter, the proxy name in the third parameter, and the bypass list in the last parameter. The following example shows why the functionWinHttpOpen may be out of date for setting proxy data.
hSession = WinHttpOpen( L"WinHTTP Sample/1.0", WINHTTP_ACCESS_TYPE_NAMED_PROXY, "proxy_name", l"
Use the WinHttpSetOption function. The WINHTTP_OPTION_PROXY banner allows you to specify proxy sets with the WINHTTP_PROXY_INFO structure. As an argument, the following code shows how a specific WinHttpSetOption function can be used to insert proxy data.
WINHTTP_PROXY_INFO ProxyInfo; proxyInfo.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY; proxyInfo.lpszProxy is L"proxy_name"; ProxyInfo.lpszProxyBypass = L"
"; // Set proxy information for this session. WinHttpSetOption(hSession, WINHTTP_OPTION_PROXY, &infoproxy, size (proxy information));
If you are writing a final script or application that uses all WinHttpRequest objects, use the following skills to change your proxy settings.
Use the exact SetProxy method. Specify the access type in the first parameter, the proxy name in the next parameter, and the bypass list in the third parameter. The following practical example shows how the methodSetProxy can be used in a script to set proxy data.
WinHttpReq.SetProxy( HTTPREQUEST_PROXYSETTING_PROXY, "proxy_server:80", "*.microsoft.com");
To specify non-payment options and eliminate the need to use the SetProxy method or the WinHttpSetOption function, use the proxy configuration utility. This utility allows you and your family to specify that your application should access the network either directly through a working proxy, or through a combination of direct access and proxy by specifying a bypass list. When using the WinHTTP API, the proxy assembly tool determines only the options that you can send to the WinHttpOpen API when passing the WINHTTP_ACCESS_TYPE_DEFAULT flag. The WinHttpRequest target uses the proxy server selection tool by default.
The proxy settings for WinHTTP are not proxy settings like Microsoft Internet Explorer. You cannot change the proxy settings for WinHTTP through the Microsoft Windows Control Panel. When using WinHTTP, the proxy server configuration utility does not control the settings you implement for Internet Explorer.
Para Command Line Strings
The table lists the command line panels available for use with the ProxyCfg.exe tool.
|none||In the case of custom settings, the current WinHTTP proxy settings are actually displayed.|
|?||Wizard information is displayed.|
|d||Indicates that WinHTTP applications access the network directly and require a proxy server.|
|r||Specifies the proxy server. You can also provide an optional report on servers available without proxy servers.|
|you||Specifies that the WinHTTP applications you see will use the current user’s proxy settings associated with Internet Explorer. This setting does not work if Internet Explorer consistently detects proxy settings, or if the problem is that the auto-configuration URL is set using proxy server information.|
|Me||Indicates that winhttp applications will use the current pro settingsvisitor’s csi server for Internet Explorer. This only works if ProxyCfg.exe was used less frequently than before. When building ProxyCfg.exe, specify that the “u” parameter for the command’s phone line uses manual settings. This setting does not work if Internet Explorer automatically detects proxy settings and uses the automatic settings URL to set proxy information.|
You can specify the proxy in any type of string separated by spaces. Each of the proxy lists can contain the old port number for accessing the proxy. To store a proxy for a specific standard protocol, the string must match the disk format,