打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Discovery Without an Auto

If a proxy auto-configuration file has not been deployed on the local network, WinHttpGetProxyForUrl cannot find a proxy server. If WinHttpGetProxyForUrl fails, there are several possible fall-back strategies for obtaining a viable proxy configuration, depending on its runtime environment. These include prompting for the proxy setting through a user interface, requiring someone to store the proxy configuration in the registry using the WinHTTP "ProxyCfg.exe" utility, or using WinHttpGetIEProxyConfigForCurrentUser to check  whether a proxy server is listed in Internet Explorer's settings.


It is possible that there is no proxy auto-configuration file because the client has a direct Internet connection, such as through an ISP, and does not need a proxy server.


A proxy server may be  required, on the other hand, but the local network may not support WPAD. In this case, the proxy configuration must be obtained from the user or found somewhere on the client machine.


A WinHTTP-based application running in a middle-tier server environment, such as a COM+ or ASP application, should rely on a server administrator setting a default proxy configuration in the registry using the "ProxyCfg.exe" utility. This default configuration information can then be retrieved either by using  the WinHttpGetDefaultProxyConfiguration function, or simply by specifying the WINHTTP_ACCESS_TYPE_PRECONFIG flag in the WinHttpOpen call.


On the other hand, a WinHTTP application running on a client desktop machine can attempt to examine Internet Explorer's proxy settings. WinHttpGetIEProxyConfigForCurrentUser fills in a caller-supplied WINHTTP_CURRENT_USER_IE_PROXY_CONFIG structure with the current user's Internet Explorer proxy settings for the current active connection (dial-up, VPN or LAN). This configuration may indicate that auto-detection is used, or it may specify a URL for a proxy auto-configuration file, or it may specify an actual proxy server to use, or it may specify a combination of the three. If this information includes a PAC URL or a proxy server, the WinHTTP application can try using those.


A sample that uses the WinHttpGetProxyForUrl and WinHttpGetIEProxyConfigForCurrentUser functions can be found in the Platform Software Development Kit (SDK) WinHTTP samples.


 


 


Send comments about this topic to Microsoft


Build date: 8/28/2013


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
配置 WinHTTP 的代理设置
Reseed fails with the error 'The connection to the specified remote host was refused' – Bits Of Exch
Odoo
Runtime Error
Connect to Bittorrent trackers, Being blocked? Try this
nginx.conf配置文件解析(http、server、location proxy
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服