Open Bug 642079 Opened 13 years ago Updated 2 years ago

Automatic proxy configuration doesn't work

Categories

(Firefox :: General, defect)

4.0 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: evsvit, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101 Firefox/4.0

Automatic proxy configuration doesn't work in Firefox 4.0. But it works in IE8. Setting debug variable in proxy.pac doesn't show any alert message. 
Below are parameters that I use:

1) Automatic proxy configuration URL: file:///C:/Users/Vitaliy/AppData/Roaming/proxy.pac

2) Source code for proxy.pac:
//Turn debug mode on by setting debug variable to any non-empty string
//Note that "" is an empty string, and that "0", "1" & "test" are not empty strings.


function FindProxyForURL(url, host)
  {
    var ip = myIpAddress();
    var debug = "";

    if(debug)
    {
        alert("proxy.pac IP=" + ip + "  HOST=" + host + "  URL=" + url);
    }

    // Detect if trying to connect to internal/intranet host
    if(isPlainHostName(host) || dnsDomainIs(host, "intranet.companyname"))
    {
 if(debug)
 {
            alert("Direct for " + url);    
     }
    return "DIRECT";   
    }

    // Detect if trying to connect to URLs on the internal network via internal DNS suffix or IP address
    if(shExpMatch(url, "*.companyname") || shExpMatch(host, "10.100.*"))
    {
 if(debug)
 {
     alert("Direct for " + url);
 } 
        return "DIRECT";    
    } 

     // All client PCs on the internal network will have a 10.10.x.x address, check if I have this
     if (shExpMatch(ip, "10.10.*"))
     {
             if(debug)
          {
                 alert("Proxy for " + url);
             }
     return "PROXY proxy.companyname:8080";
     }

     // If you have a different IP then this isn't the company network
     else 
     {
             if(debug)
          {
      alert("You are not at CompanyName so going direct for " + url);
             } 
            return "DIRECT";
     }

  }

Reproducible: Always

Steps to Reproduce:
0. Connect your PC to internal network that is not directly connected to Internet but connected through a proxy only.
1. Create proxy.pac file with the source specified in Details section. Modify source code according to your internal network and proxy settings.
2. Go to Firefox network connection settings and specify Automatic proxy configuration URL pointing to your proxy.pac file, similar way as shown in Details section.
3. Go to URL http://mail.google.com and see that page is not loaded.
Actual Results:  
page not loaded

Expected Results:  
Firefox is asking for proxy login and password, page is loaded.
I don't think that a PAC file is supposed to display alert's.
(In reply to comment #1)
> I don't think that a PAC file is supposed to display alert's.

But it does display ones in IE8. And the subject of bug is not that.
(In reply to comment #1)
> I don't think that a PAC file is supposed to display alert's.

I'm sorry. I see now that the subject of bug contains the "alerts" thing. I think I should have not mention them, because "not showing alerts" could be a specific behavior of Firefox. But overall - the script should work. But it doesn't.
Version: unspecified → 4.0 Branch
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.