Wednesday 16 November 2011

WPAD interpreting issue with Firefox v8

If you are experiencing WPAD related proxy access problems via Firefox v8 and if you use a Windows that supports IPv6 your problem's cause can be Firefox's weird behaviour when it comes to detect client's IP address.
  1png

 

In my case Firefox v8 was always trying to detect and return an IPv6 address even whilst IPv6 was disabled or not configured. It was returning ::1 when IPv6 was disabled. So these behaviour causes problem during interpreting a WPAD file created by IPv4 addresses.

To test it and be ensure your problem is same as above; create a simple WPAD.dat file with the command lines below.
function FindProxyForURL(url, host)
{
client_ip = myIpAddress();
alert(client_ip);
}

Our goal here is returning detected IP adress by Firefox to user by using alert(myIpAddress()); command. Run Firefox when your new wpad.dat is ready, configure options to use it and try to browse any url.

Press Shift + Ctrl + J to open Error Console when you get the error again.
  Image3

The Error console will show you the detected IP address by the browser , if it IPv6 or ::1 go to your address field and browse about:config
Write IPv6 to filter area, it will list network.dns.disableIPv6 and highly possibly you've got false for the value.

Image4

Change value to True by double clicking, this change will force Firefox to get IPv4 addresses from the client and will fix WPAD interpreting issue.

Image5

You can also use the batch file below if you'd like to do this change by a batch file.

cd /D "%APPDATA%MozillaFirefoxProfiles"
cd *.default
set ffxpath=%cd%
echo user_pref("network.dns.disableIPv6", true);>>"%ffxpath%prefs.js"
set ffxpath=

1 comment:

  1. You are awesome! Thank you so much for this, you saved me!!

    ReplyDelete