WinHTTP 自动代理支持
2015-05-14 08:00
225 查看
To ease the configuration of proxy settings, WinHTTP 5.1 implements the Web Proxy Auto-Discovery (WPAD) protocol, also known as autoproxy.
为简化代理配置,WinHTTP 5.1实现了Web代理自动发现协议(WPAD),也叫autoproxy。
the client's local network to the Internet (for example, this is often the case for Web clients on a corporate LAN). For server-based applications, the proxy configuration is normally managed by the server's administrator using the WinHTTP ProxyCfg.exe utility.
The server administrator knows the name of the proxy server in advance and uses ProxyCfg.exe to record this setting in the registry where WinHTTP can look it up. However, requiring client desktop end-users to manually configure WinHTTP proxy settings is problematic.
The end-user may not know the name of the proxy server; requiring the end-user to run the ProxyCfg.exe utility can be a support burden for an organization. To support a good user experience, a web-enabled client application should determine the proxy configuration
without user intervention.
使用WinHTTP的程序和组件发送HTTP请求要保证代理设置正确。除非客户是直连上网,HTTP请求都会发送给连接客户和Internet的web代理(这在Web用户和公司内网很常见)。对于基于服务器的程序来说,代理设置通常由服务器管理员使用WinHTTP的ProxyCfg.exe管理。管理员知道代理服务器的名称,并使用ProxyCfg.exe把这些设置记录到注册表里,以便WinHTTP找到它。然而要求客户端的桌面终端用户手动配置WinHTTP代理设置会产生很多问题。终端用户有可能不知道代理服务器名称,让用户运行ProxyCfg.exe工具也是一个负担很重的工作。要有好的用户体验,基于web的应用程序应该可以自动探测代理配置而不需要用户干预。
To make configuring the proxy settings for WinHTTP-based applications easier, WinHTTP now implements theWeb Proxy Auto-Discovery (WPAD) protocol, often referred
to asautoproxy. This is the same protocol that web browsers implement to automatically discover the proxy configuration without requiring an end-user to specify a proxy server manually. This feature is available starting with WinHTTP version 5.1 in
Windows 2000 Service Pack 3, Windows XP Service Pack 1 and Windows Server 2003. Note that although both Microsoft Internet Explorer and Microsoft WinHTTP support WPAD, the specification never progressed beyond the "Internet-Draft" stage, and expired in May
2001.
为了使基于WinHTTP的程序使用代理更简单,WinHTTP实现了Web Proxy Auto-Discovery (WPAD) 协议,也常被称为autoproxy。浏览器也实现了同样的无需用户干预的代理发现功能。这个功能从WinHTTP5.1开始实现,默认的在2000 SP3 、XP SP1以及Server
2003及以后操作系统都实现了上述功能。
The WPAD protocol works as follows:
WPAD协议按以下方式工作:
Using the DHCP and/or DNS network protocols, the URL of a Proxy Auto-Configuration (PAC) file is discovered. The URL identifies a PAC file on the client's local network. WinHTTP supports only "http:" and "https:" PAC URLs; it does not, for example, support
"file:" URLS.
使用DHCP和/或DNS网络协议,发现一个标识代理自动配置文件的URL.这个URL在用户本地网络发现一个PAC文件,WinHTTP只支持形如"http:" 和"https:"的 PAC URLs。
The PAC file is downloaded and optionally cached on the client's computer. The PAC file is an executable script that generates a list of one or more proxy servers given a target host name and URL. WinHTTP supports only ECMAScript-based PAC files.
PAC文件下载并根据选项是否存储在用户计算机本地。这个PAC文件是一个可执行的脚本,这个脚本产生一个列表,这个列表中有一个或多个以URL或主机名出现的代理服务器。WinHTTP只支持ECMA脚本PAC文件。
On each HTTP request, the PAC script code is executed, with the host name and URL of the HTTP request passed in as parameters. WinHTTP expects the PAC script code to contain a function calledFindProxyForURL, in the form:
对每个HTTP请求,PAC脚本代码都执行,使用HTTP请求URL或主机名作为参数。WinHTTP要求PAC脚本包含一个叫FindProxyForURL函数,
This function computes a list of one or more proxy servers that can be used by the HTTP client in order to transmit the request. If the PAC script determines that the HTTP client can reach the target server directly without going through a proxy server
at all, it indicates this using a special return value.
这个函数计算一个列表,这个列表中包含一个或多个代理服务器,HTTP客户端使用这些服务器转发请求。如果PAC脚本探测到HTTP客户端可以不使用代理直接访问网络,就会返回一个特定的值。
Discovery Without an Auto-Config File
AutoProxy Issues in WinHTTP
Setting WinInet Proxy Configurations in WinHTTP
AutoProxy Cache
IPv6 Extensions to Navigator Auto-Config File Format
为简化代理配置,WinHTTP 5.1实现了Web代理自动发现协议(WPAD),也叫autoproxy。
AutoProxy总览
Applications and components that use WinHTTP to send HTTP requests should ensure that the proxy configuration is set correctly. Unless the client has a direct Internet connection, an HTTP request should normally be sent through a web proxy server that connectsthe client's local network to the Internet (for example, this is often the case for Web clients on a corporate LAN). For server-based applications, the proxy configuration is normally managed by the server's administrator using the WinHTTP ProxyCfg.exe utility.
The server administrator knows the name of the proxy server in advance and uses ProxyCfg.exe to record this setting in the registry where WinHTTP can look it up. However, requiring client desktop end-users to manually configure WinHTTP proxy settings is problematic.
The end-user may not know the name of the proxy server; requiring the end-user to run the ProxyCfg.exe utility can be a support burden for an organization. To support a good user experience, a web-enabled client application should determine the proxy configuration
without user intervention.
使用WinHTTP的程序和组件发送HTTP请求要保证代理设置正确。除非客户是直连上网,HTTP请求都会发送给连接客户和Internet的web代理(这在Web用户和公司内网很常见)。对于基于服务器的程序来说,代理设置通常由服务器管理员使用WinHTTP的ProxyCfg.exe管理。管理员知道代理服务器的名称,并使用ProxyCfg.exe把这些设置记录到注册表里,以便WinHTTP找到它。然而要求客户端的桌面终端用户手动配置WinHTTP代理设置会产生很多问题。终端用户有可能不知道代理服务器名称,让用户运行ProxyCfg.exe工具也是一个负担很重的工作。要有好的用户体验,基于web的应用程序应该可以自动探测代理配置而不需要用户干预。
To make configuring the proxy settings for WinHTTP-based applications easier, WinHTTP now implements theWeb Proxy Auto-Discovery (WPAD) protocol, often referred
to asautoproxy. This is the same protocol that web browsers implement to automatically discover the proxy configuration without requiring an end-user to specify a proxy server manually. This feature is available starting with WinHTTP version 5.1 in
Windows 2000 Service Pack 3, Windows XP Service Pack 1 and Windows Server 2003. Note that although both Microsoft Internet Explorer and Microsoft WinHTTP support WPAD, the specification never progressed beyond the "Internet-Draft" stage, and expired in May
2001.
为了使基于WinHTTP的程序使用代理更简单,WinHTTP实现了Web Proxy Auto-Discovery (WPAD) 协议,也常被称为autoproxy。浏览器也实现了同样的无需用户干预的代理发现功能。这个功能从WinHTTP5.1开始实现,默认的在2000 SP3 、XP SP1以及Server
2003及以后操作系统都实现了上述功能。
The WPAD protocol works as follows:
WPAD协议按以下方式工作:
Using the DHCP and/or DNS network protocols, the URL of a Proxy Auto-Configuration (PAC) file is discovered. The URL identifies a PAC file on the client's local network. WinHTTP supports only "http:" and "https:" PAC URLs; it does not, for example, support
"file:" URLS.
使用DHCP和/或DNS网络协议,发现一个标识代理自动配置文件的URL.这个URL在用户本地网络发现一个PAC文件,WinHTTP只支持形如"http:" 和"https:"的 PAC URLs。
The PAC file is downloaded and optionally cached on the client's computer. The PAC file is an executable script that generates a list of one or more proxy servers given a target host name and URL. WinHTTP supports only ECMAScript-based PAC files.
PAC文件下载并根据选项是否存储在用户计算机本地。这个PAC文件是一个可执行的脚本,这个脚本产生一个列表,这个列表中有一个或多个以URL或主机名出现的代理服务器。WinHTTP只支持ECMA脚本PAC文件。
On each HTTP request, the PAC script code is executed, with the host name and URL of the HTTP request passed in as parameters. WinHTTP expects the PAC script code to contain a function calledFindProxyForURL, in the form:
对每个HTTP请求,PAC脚本代码都执行,使用HTTP请求URL或主机名作为参数。WinHTTP要求PAC脚本包含一个叫FindProxyForURL函数,
FindProxyForURL( url, host );
This function computes a list of one or more proxy servers that can be used by the HTTP client in order to transmit the request. If the PAC script determines that the HTTP client can reach the target server directly without going through a proxy server
at all, it indicates this using a special return value.
这个函数计算一个列表,这个列表中包含一个或多个代理服务器,HTTP客户端使用这些服务器转发请求。如果PAC脚本探测到HTTP客户端可以不使用代理直接访问网络,就会返回一个特定的值。
AutoProxy Topics
WinHTTP AutoProxy FunctionsDiscovery Without an Auto-Config File
AutoProxy Issues in WinHTTP
Setting WinInet Proxy Configurations in WinHTTP
AutoProxy Cache
IPv6 Extensions to Navigator Auto-Config File Format
相关文章推荐
- Http 代理工具 实战 支持网页与QQ代理
- HttpWebRequest提高效率之连接数,代理,自动跳转,gzip请求等设置问题
- Http 代理工具 实战 支持网页与QQ代理
- wget是一个从网络上自动下载文件的自由工具,支持通过HTTP、HTTPS、FTP三个最常见的TCP/IP协议下载,并可以使用HTTP代理
- 简单实现Http代理工具--完善支持QQ代理
- 使用 http proxy 软件 Polipo 让 easy_install 支持使用代理安装
- nginx启用HSTS以支持从http到https不通过服务端而自动跳转
- winlnet跟winhttp访问的代理问题
- HttpWebRequest提高效率之连接数,代理,自动跳转,gzip请求等设置问题
- 配置 WinHTTP 的代理设置
- [转]HttpWebRequest提高效率之连接数,代理,自动跳转,gzip请求等设置有关问题
- 在WinHTTP中设置WinINet 代理配置
- NO.19 HttpConnection、HttpClient使用注意点(附http连接工具:采用HttpClient支持代理Proxy、支持用户名密码、支持域Domain模式)
- HTTP协议中支持代理和压缩的相关字段
- 网站自动点击,支持代理更换
- 简单实现Http代理工具--完善支持QQ代理
- HTTP代理实现请求报文的拦截与篡改8--自动设置及取消代理
- 配置 WinHTTP 的代理设置
- 简单封装下rest api,支持http,https及代理模式
- win 10 使用本地代理自动配置pac