Windows 8 Internet Explorer 11代理自动化脚本

与这篇文章类似,我想使用脚本更改我的代理设置。 但是,它失败了。 当我在代理后面时,IE不能连接到互联网。 在这里,我尝试克雷格的第一个解决scheme:

function FindProxyForURL(url, host) { if (isInNet(myIpAddress(), "myactualip", "myactualsubnetip")) return "PROXY proxyasshowninpicture:portihavetouseforthisproxy_see_picture"; else return "DIRECT"; } 

这个脚本在c:\ windows下保存为proxy.pac,我的configuration是在局域网设置中:没有自动检测到的设置,是的,使用自动configuration脚本:file:// c:/windows/proxy.pac没有代理服务器。

那么,我做错了什么?

—————-更新————–

但是,当我在我的LANconfiguration中设置代理时:

 IE -> Internet Options -> Connections -> LAN Settings check: Use a proxy Server for your LAN Address: <a pingable proxy> Port: <portnr> 

这个环境一切都很好。 现在我尝试一个更简单的脚本

 function FindProxyForURL(url, host) { return "PROXY <pingable proxy>:<portnr>; DIRECT"; } 

有了上面描述的configuration**,我无法通过代理。

最后这个页面引导我到我的解决scheme:

 file://-based proxy scripts are deprecated in IE11. 

有一些临时的registry黑客给出,但我无法让我的脚本与registry工作。 最后我设置了一个本地的IIS服务器

 Windows Start - "Control Panel." - click "Programs" link - "Turn Windows Features On or Off." Check the box labeled "Internet Information Services." Click "OK." 

并移动我的* .pac JavaScript文件的内容

 function FindProxyForURL(url, host) { return "PROXY <proxyIP>:<proxyPort>; DIRECT"; } 

进入inetpub \ wwwroot。

之后,我在IE-> Internet选项 – >连接 – >局域网设置中选中了“使用自动configuration脚本”。 使用\ inetpub \ wwwroot \ scriptFilename。