Home Dashboard Directory Help
Search

file:/// URIs are not Supported for Locating Proxy Automatic Configuration Scripts by Nektar


Status: 

Closed
 as Fixed Help for as Fixed


Type: Bug
ID: 790049
Opened: 6/12/2013 7:52:51 PM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

During development, one often needs to use different proxies for different URLs in his HTML code compared to the end user or needs to quickly switch proxies on the fly. Having a local proxy automatic configuration script which you can quickly edit e.g. in Notepad and have it reloaded just by refreshing the page is very handy for accomplishing the above development tasks. However, hosting a proxy automatic configuration script on the local filesystem requires the use of "file:///" URIs.
According to the specification, file URIs that do not specify a hostname should have three slashes in front of them, such as file:///proxy.pac instead of file://proxy.pac. Other browsers such as Chrome and Firefox support file URIs with three slashes when specifying a proxy automatic configuration script. Internet Explorer though ignores it and only accepts file URIs that have two slashes. However, some other browsers do not accept file URIs with two slashes and they only accept URIs with three. Since specifying a proxy automatic configuration script is usually set system-wide using the "Connections tab > LAN Settings" dialog of "Internet Options" in Control Panel, you can't make your locally hosted script work with all browsers because if you specify e.g. "file://proxy.pac" Internet Explorer will work but not all other browsers and if you specify "file:///proxy.pac" other browsers will mostly work but not Internet Explorer. Since testing with all modern browsers during development is a must, the above scenario needs to work.
In any case, clearly Internet Explorer does not behave according to spec here hence this bug.
Note that I think that the same problem does not occur when using "file:///" URIs to load an HTML page from the local filesystem and so the problem is limited to loading proxy automatic configuration scripts.
Details
Sign in to post a comment.
Posted by EricLaw [ex-MSFT] on 3/21/2014 at 8:24 AM
http://blogs.msdn.com/b/ieinternals/archive/2013/10/11/web-proxy-configuration-and-ie11-changes.aspx

1. IE11 does not permit FILE:// sourced PAC scripts.
2. Yes, WinINET requires the "unhealthy" syntax for FILE URI-PAC scripts in IE10 and earlier.
Posted by Microsoft on 6/13/2013 at 1:53 PM
Thank you for your feedback.

The proper "file path" for Internet Explorer to see your Pac file is:
file://C:/Windows/system32/drivers/etc/proxy right next to the hosts file. There is no file type and this should work on most browsers.

If it does not you can also use a UNC path:
EX: file:////IP_or_hostmane\path\filename.pac

Best regards,

The Internet Explorer Team
Sign in to post a workaround.