proxy.pac files, Mozilla (Firefox & Thunderbird) and Vista or Windows 7

Published: | by Julian Knight Reading time ~2 min.
📖 Posts | 📎 Software | 🔖 Configuration, Vista, Win7

I’ve found a problem with Mozilla based products and proxy settings. To automatically configure a proxy for use by Internet browsers, you can use a file called “proxy.pac“. This is a JavaScript function that is loaded into the browser when it starts and redirects requests via a proxy where required. All of the descriptions for this file you will find on the Internet will provide the following example of checking your current IP address. This is used for laptops where the IP address will change depending on where you are. You can check when the laptop is on the corporate network and redirect requests via the corporate proxy as needed:

Well, this does not work for Mozilla based applications (for example Firefox and Thunderbird) if you are using Microsoft Vista or Windows 7. That is because, under those operating systems, the internal function myIpAddress() does not return an IPv4 address as expected (e.g. 10.10.10.5) but an IPv6 address instead (e.g something longer with lots of “:”). In order to make your proxy.pac file work with both IE and Mozilla, use something like:

You can discover your IPv6 address in several ways but the trusty command line “ipconfig /all” shows you everything you need. See also this discussion on the Mozilla support forums: proxy.pac myIpAddress() returns incorrect format?

Del.icio.us : Configuration, Software, Vista, Win7 Technorati : Configuration, Software, Vista, Win7 Diigo Tag Search : Configuration, Software, Vista, Win7


comments powered by Disqus