Closed Bug 204604 Opened 23 years ago Closed 22 years ago

PAC: ret = FindProxyForURL(url, host); fails

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: donal.hunt, Assigned: darin.moz)

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030505 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030505 The network.proxy.autoconfig_url in the latest build release (and in past releases) does not work. Using manual proxy settings allows a user to connect to the relevant proxy server. Using the above preference results in no webpages being loaded. Reproducible: Always Steps to Reproduce: 1. change the preferences to use automatic configuration script. 2. attempt to access external websites (local websites display ok) Actual Results: no page loads - status page is still attempting to load the page but fails after a minute or two. Expected Results: should have connected to the proxy server specified in the proxy.pac file and loaded the website. proxy.pac file: // DCU standard proxy autoconfiguration script. // // Tested on Netscape 4.x // IE 4.x // IE 5.x // IE 6.x var url; var host; function FindProxyForURL(url, host) { // So we get Netscape errors on no host rather than a Squid // error saying contact sysops@dcu.ie. if (!isResolvable(host)) return "DIRECT"; if (isPlainHostName(host) || isInNet(host, "136.206.0.0", "255.255.0.0") ) { return "DIRECT"; } else { // Order is important here - IE works right to left I'm told // Netscape works left to right (ie: Direct has to be in middle). return "PROXY proxy2.dcu.ie:3128; PROXY proxy.dcu.ie:3128; DIRECT; PROXY proxy.dcu.ie:3128; PROXY proxy2.dcu.ie:3128"; } } ret = FindProxyForURL(url, host);
Are you saying that all PAC is broken, or just your file?
QA Contact: benc → pacqa
Summary: using the network.proxy.autoconfig_url preference results in no external internet connectivity → PAC: using the network.proxy.autoconfig_url preference results in no external internet connectivity
the PAC file i included is definately broken (it works with IE and Netscape 4.x). If you have another PAC file you want me to test let me know...
have the same problem with w2000..... linux 1.4b works !!! also all older releases of mozilla under windows and linux work with the same pac file...
OK - just installed mozilla 1.4b and the same problem still exists. Further investigation shows that mozilla doesn't like this line: ret = FindProxyForURL(url, host); I can't remember which broswer it is, but one of the browsers in common use needs this line for the proxy.pac file to work. There's argument here that says that the other browser is broken, but as i'm going to give a guess it's IE, it's going be hard to justify removing the line. Can mozilla be told to ignore the line?
there must be something different between the mozilla 1.4b windows and the linux windows build and the pac handling .... when you try it with the linux version it works... i've the same pac file on my web server and looks working with all browsers, except the 1.4b windows version...
I have exactly the same problem. I am using Windows NT 4. All versions of Mozilla until 1.3.1 work fine, but Mozilla 1.4b refuses to load the proxy PAC URL. The proxy.pac file contains the findProxyForUrl(url, host) command.
Have you installed mozilla in an EMPTY directory and not over an older build ? (that means: uninstalling mozilla, delete all files in the mozilla application directory [except the plugins subfolder] and reinstall mozilla)
Just installed mozilla 1.4b onto a win2k desktop that has never seen mozilla before. The only preference I changed was the "network.proxy.autoconfig_url" one. The problem is re-produced on this brand new install. I now have two PAC files. proxy.pac that includes the line "ret = FindProxyForURL(url, host);". mozilla.pac that doesn't include "ret = FindProxyForURL(url, host);". mozilla.pac works on both my PC and the one above. proxy.pac works on neither.
i don't think it makes any sense to be calling FindProxyForURL in the body of your PAC file. this bug seems invalid to me. the browser will call your FindProxyForURL function... marking INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
but it looks like a bug !!! why the same pack files works with 1.4b linux and not with 1.4b windows ????? all other browsers can use the pac file, only the windows 1.4b has problems...
Maybe if you could explain the reasoning for this line, we could discuss this further. PAC has a specification: http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html My javascript is basically limited to supporting PAC, but as I understand it, your file contains just the script for your FindProxyForURL. The browser calls that function via the line you say doesn't work. Here's the top paragraph: The proxy autoconfig file is written in JavaScript. The file must define the function: function FindProxyForURL(url, host) { ... } which will be called by the Navigator in the following way for every URL that is retrieved by it: ret = FindProxyForURL(url, host);
Summary: PAC: using the network.proxy.autoconfig_url preference results in no external internet connectivity → PAC: ret = FindProxyForURL(url, host); fails
i'm german speaking, so my english is sometime not understandable :-( sorry.. but i've this problem only on windows platforms with release 1.4b... with the linux build it works.... i use the same pack file for all browser in our office.. all (IE,Netscape 4.X, Mozilla 1.3*, Mozilla 1.4b/linux) work... but only the windows 1.4b beta not !!!! please make a short test with the windows and the linux version and you will see the problem....
hmm.. i tried this PAC file under win2k and it actually works for me. i tested the 20030512 mozilla trunk. i'm curious... how did you install mozilla 1.4 beta? did you uninstall 1.3 first?
i've done a complete uninstall and delete the folder of the old mozilla installation... then install new, it looks working.. but i've to verify it on the other workstations...
With regard to Darin Fisher's comment - it doesn't make any sense to be calling FindProxyForURL in the body of the PAC file. However, at least one popular browser out there (I believe it's one of the versions of Internet Explorer) has broken javascript support and requires the line to be present. I can't confirm whether DCU's proxy.pac (the one we want to use - which includes the line)) works for Mozilla 1.4b on Linux, but I'll check it out later today. Also I've comfirmed the bug on a second workstation (comment #8).
for me.. its fixed... after deleting the old installation on windows and reinstall, it works.. for people having trouble with pac.. my pac files looks 1:1 as following sample.. it works with all browser used here... ie, netscape, mozilla.. stored in dos format... on the unix server, crlf ending lines ---------- sample.pac -------------- function FindProxyForURL(url, host) { if ( shExpMatch(url,"*localhost*") || shExpMatch(url,"*127.0.0.1*") || shExpMatch(url, "*somehost*") ) return "DIRECT"; else return "PROXY 172.16.1.1:3128;"; }
ok, please ignore my comments about FindProxyForURL being called in the body of the PAC file. that should not matter to mozilla. it was just my own confusion about how PAC works that got in the way of realizing that this is just a duplicate of the recent flurry of bugs about having to completely uninstall the old version of mozilla before upgrading to 1.4. reopening to mark as duplicate.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
*** This bug has been marked as a duplicate of 205514 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → DUPLICATE
reopening... jumped the gun it seems. comment #8 invalidates the duplicate resolution.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
frank and oliver are experiencing bug 205514, but the bug reported by donal is still unresolved. donal: can you do me a favor and capture a HTTP log using the steps described here: http://mozilla.org/projects/netlib/http/http-debugging.html if you could attach the resulting log file to this bug report or email it to me directly that would be most helpful. thanks!
Thanks for re-opening the call. The attachment should be online now. As an aside, we've decided to remove the line on one of our production boxes to see if anyone screams. If no-one screams, it may be worth closing the call and putting a note in the proxy documentation saying "if you have this line in your proxy.pac file, remove it or mozilla won't work!!". ;-)
donal: ok, thanks for the log file. unfortunately, the only thing it tells me is that your PAC file is not loaded. i figured as much, but i just wanted to make sure. can you please upload the bad PAC file as an attachment to this bug report. maybe put it into a zip archive first before uploading. that way i can unzip and see the exact format of your PAC file with line endings preserved, etc. thx!
As requested, the PAC file that fails to load in mozilla 1.4b
I experienced also a problem with the proxy.PAC file which my company uses also for load balancing. Some links worked while others got the error message "The proxy server you have configured could not be found. Please check your proxy settings and try again". When I tried the proxies manually, I found that one proxy server did not work. Wen examining the proxy.pac file I saw that the load-balancing is done by a hash of the URL which then is used to decide whether to use proxy in the order as returned from FindProxyForURL() = "proxy1; proxy2" or "proxy2; proxy1" Therefore I believe that Mozilla does not try ALL proxies in the list returned by the function FindProxyForURL(url, host). I guess it starts from the beginning, but does not continue correctly with the next proxy server URL. Example from FindProxyForURL(url, host) from our proxy.PAC ... ---------------------------------------------------- var n = URLhash2(url) % 2; if (n < 1) return "PROXY ext-proxy1.siemens.se:8080; PROXY ext-proxy2.siemens.se:8080; "; if (n < 2) return "PROXY ext-proxy2.siemens.se:8080; PROXY ext-proxy1.siemens.se:8080; "; ---------------------------------------------------- I am using Windows NT 4 + Mozilla 1.3 My collegue using WinXP and IE6 never felt any problems because of the failing proxy server because IE just went on to the next working proxy server.
A quick update as I haven't touched the bug in nearly a year! As mentioned in comment #21, we removed the "ret = FindProxyForURL(url, host);" line from the proxy.pac file and no one has screamed to date. I think this bug can be closed as a result.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago22 years ago
Resolution: --- → INVALID
VERIFIED/INVALID: We aren't going to support this. We load the PAC into a larger pile of Javascript code, maybe some errors show up in console, if you want to figure out what is going on.
Status: RESOLVED → VERIFIED
OS: Windows 2000 → All
QA Contact: pacqa → benc
Hardware: PC → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: