local .pac-file URL format that works with IE and Safari (Windows)?

Solution 1:

For IE and the windows platform, the correct location for a local pac file seems to be:

file://C:/Windows/system32/drivers/etc/proxy

next to your hosts file.

Solution 2:

This feature is no longer supported in W8.1 since the file:// schema was never supported by WinHTTP. So tools that use WinHTTP for proxy settings will not recognize it.

Also note:

In November 2012, the .NET Framework was changed to use WinHTTP for PAC processing, which means that, by default, .NET Applications will not support file://-based proxy scripts any longer either.

If you want to enable the file protocol for later version than IE10 you can always use the following registry setting:

  • Key: HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\
  • Value: EnableLegacyAutoProxyFeatures
  • Type: REG_DWORD
  • Data: 1

See section "NOTE: File://-based Proxy Scripts Deprecated" here.

Solution 3:

What happens if you use the dot, as Wikipedia also discusses: file://./C:/proxy.pac? So long as it is not on a sharename, this "spelling" of the path might be acceptable to both IE and Safari.

Alternatively, run a local webserver and serve the .pac file, then provide the URL as http://localhost/path/to/proxy.pac. That should work around the differences in path URL formats by avoiding using a path URL entirely.