Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

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=

Firefox v8 de WPAD problemini gidermek

Eger Firefox versiyon 8'i IPv6 destekleyen bir Windows surumu uzerinde kullaniyorsaniz ve kullaci dogrulama kaynakl sorunlar yasiyorsaniz sorunun sebebi FFox 8 de bulunan WPAD yorumlama hatasindan kaynaklaniyor olabilir.
  1png

 

Sorun benim gordugum kadari ile IPv6 ag kartinda iptal edilmis olsa bile Firefox 8 in Windows 7 isletim sisteminde illaki IPv6 adresi bulmaya calismasindan kaynaklaniyor, servis iptal olsa bile ::1 adresi donduruyor bu da WPAD iceriginin yanlis yorumlanmasina yol aciyor, ve siz eger bir Proxy belirtmisseniz bu kriterlere uymadigindan Direct degerini alabiliyor.

Basitce test etmek icin baska bir WPAD.dat dosyasi yaratarak icine sadece asagidaki komutlari ekleyin


function FindProxyForURL(url, host)
{
client_ip = myIpAddress();
alert(client_ip);
}



Burada amacimiz alert(myIpAddress()); ile kullaniciya browserin aldigi IP adresini gostermek.

Firefox u acip hatayi altiginizda Shift + Ctrl + J ile Error console u aciniz

  Image3

 

Error console size browserin gordugu adresi gosterecektir. Yukaridaki gibi bir adres veya ::1 donuyorsa bu sorunu gidermek icin Firefox'ta adres kismina about:config yazin. sonra filter kismna ipv6 yazinca asagidaki degeri goreceksiniz (network.dns.disableIPv6) ,

 
  Image4

 

bu degeri cift tiklayip True yaparsaniz Firefox IPv6 adresleri yerine IPv4 adreslerine oncelik verecek ve WPAD dosyanizi dogru yorumlayabilecektir.

  Image5

 

Eger bu islemi bir batch yardimi ile otomatiklestirmek isterseniz. Asagidaki sekilde bir batch dosyasi olusturabilirsiniz.


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