IE11下代理自动配置脚本

IE11下代理自动配置脚本

1.自动配置脚本地址由原来的同时支持网络文件路径以及本地文件路径更改为仅支持网络文件路径 例如原来配置“使用自动配置脚本”-“地址”时可以使用"file://C:\Proxy.pac"现在只能使用"http://127.0.0.1:10086/Proxy.pac"。 如果不把Proxy.pac文件放到服务器上,就只能本地创建一个Http服务器来供IE加载Proxy.pac文件了。

2.PAC文件中的alert函数不再弹出
对于一个包含如下内容的PAC文件

function FindProxyForURL(url, host)
{
    alert(url);
}

如果在IE11之前,是能够弹出地址的,IE11不再弹出alert提示框。

3.PAC文件中的API,dnsResolve特性发生改变
在调用dnsResolve之前需要先检查isPlainHostName原先:

hostIP = dnsResolve(host);

现在:

if(isPlainHostName(host)) { return "DIRECT"; } else { hostIP = dnsResolve(host); }

dnsResolve Resolves hostnames to an IP address.This function can be used to reduce the number of DNS lookups

isPlainHostName This function will return true if the hostname contains no dots, e.g. http://intranet Useful when applying exceptions for internal websites, e.g. may not require resolution of a hostname to IP address to determine if local.

参考资料: ###

FindProxyForURL: PAC Functions http://findproxyforurl.com/pac-functions/