The function FindProxyForURL in pac (proxy-auto-config) file can not work in IE browser

EvanChen picture EvanChen · Apr 17, 2013 · Viewed 7.9k times · Source

we spent three days still could not solve a strange technical problem, so we need your help.

The pac (proxy-auto-config) file we write is working fine in all other browser, except IE(Internet Explorer).

the request url is

https://news.google.com.hk/nwshp?hl=zh-CN&tab=wn

if pac file is

function FindProxyForURL(url, host) {

    if(/news/i.test(url)) return "PROXY 127.0.0.1:8087";

    return  "DIRECT";
}

it is right, it is using proxy to visit the website.

however if the pac file change to

function FindProxyForURL(url, host) {

    if(/CN/i.test(url)) return "PROXY 127.0.0.1:8087";

    return  "DIRECT";

}

CN, is also in the url. but IE do not using proxy to visit the website, like we think.

However we test in other browser like Chrome, Safari, Firefox, they all run well , they all using proxy to visit the website.

It seems like in the IE, the parameter "url" in the function FindProxyForURL(url, host), is not full path of url, it just contain the host,but in other browser it is the full url.

We have taken 3 days on this problem, Do you have some idea to let the function in IE pac file to get the full url, or have a method to debug the pac file in IE browser.

We even cannot alert infomation in browser.

Our IE version is 10, Windows 8.

Answer

0x1mason picture 0x1mason · Jul 18, 2013

See http://support.microsoft.com/kb/271361

You need to set HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\EnableAutoProxyResultCache to DWORD 0.