Proxy: localhost and should be proxyable, but not by default

VERIFIED FIXED in mozilla1.2beta



19 years ago
16 years ago


(Reporter: bbaetz, Assigned: benc)



Firefox Tracking Flags

(Not tracked)



(2 attachments, 1 obsolete attachment)



19 years ago
I've been trying out PSM with the latest CVS build.

Clicking on the padlock icon doesn't work because it tries to connect to
http://3@ but this gives me a connection refused error from
the proxy.

I'm using manual proxies since autoproxy doesn't work yet, and didn't have
localhost, listed in the "No proxies for" section. Once I add this,
then it works fine.

I've checked that trying http://{localhost,} tries to go through the
proxy, so its not a PSM problem.

This could be resolved as user error, but if PSM relies on this then I think it
should be the default.

Comment 1

19 years ago
Adding myself to keep me in the loop.

Comment 2

19 years ago
As far as localhost going through a proxy - I think it should. Netscape 4.X does
this, and if I have my proxy on localhost and/or properly set up then I *want*
localhost to go through the proxy server - especially if I'm using it as some
sort or debugging tool. So, I think this portion of the bug is wontfix or
invalid, which I think the reporter already new - but was just pointing out to
show what is causing problems with the PSM stuff. :)

As far as the PSM stuff going through the proxy - yeah, bad!
marking a duplicate of bug 31164.

*** This bug has been marked as a duplicate of 31164 ***
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE

Comment 3

19 years ago
verified DUP

Comment 4

18 years ago
+qawanted - need to verify behavior in something recent link M0.9.
change summary for searchability.
The duped bug isn't really a dupe.

Joe's point is very good, send everything to the proxy, and use "no proxy" if 
you do not want it to.

If "no proxy" has bugs (and it does), comment here and we'll mark a depends.
Keywords: qawanted
Resolution: DUPLICATE → ---
Summary: localhost and should not go through the proxy → Proxy: localhost and should be proxyable

Comment 5

18 years ago
qa to me.
-> new
Ever confirmed: true
QA Contact: tever → benc

Comment 6

18 years ago
Bug 80848, might make it so you cannot get out of proxying "localhost".


18 years ago
Target Milestone: --- → mozilla1.0
Well, I filed this originally, but I can't remember what I was thinking :) It
was mainly PSM bug IIRC - I shouldn't have had to avoid proxying to localhost if
I wasn't expecting to connect there.

A current branch build does allow localhost to be proxied.

Comment 8

18 years ago
*** Bug 88261 has been marked as a duplicate of this bug. ***

Comment 9

18 years ago
+mostfreq  <wow, this is really annoying people...>
Keywords: mostfreq

Comment 10

18 years ago
*** Bug 86449 has been marked as a duplicate of this bug. ***

Comment 11

18 years ago
I don't see how you can make them proxyable - what if your proxy is on another
server ? IMHO, there should simply be a default entry in 'No proxy for' of, localhost. Then if people *really* want to use a proxy for that
address they can just delete it.
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
Target Milestone: mozilla1.0 → mozilla1.0.1

Comment 13

18 years ago
localhost, should by default be in the "No Proxy For" field.
This is what most people want, and can be easily changed by the minority.

Comment 14

18 years ago
I think gabriel came up with this idea first, about chaning the defaults.

I've been meaning to make this as my first attempt to patch, but if anyone wants
to do it, go ahead.

I think the idea would be to add the following line to all.js:

pref("network.proxy.no_proxies_on", "localhost,");

Since this is a prefs change, I think this could be done anytime, even for 0.9.7
if someone could come up with a really good reason...
IE has a checkbox 'do not use proxy server for local addresses', by default

I think putting localhost, on do not use proxy for is a better solution.

Comment 16

17 years ago

I've tested a bunch of combinations of no-proxy so that I know I've got the
correct configuration.

And I think I'm making enough progress getting CVS access, installing compilers
and other build/patch stuff where I will actually be able to build the patch and
submit it soon.

Officially, it would be good for someone to volunteer to qa the change as well...
Assignee: gagan → benc
*** Bug 130296 has been marked as a duplicate of this bug. ***
*** Bug 145876 has been marked as a duplicate of this bug. ***

Comment 19

17 years ago
*** Bug 164532 has been marked as a duplicate of this bug. ***

Comment 20

17 years ago
*** Bug 164802 has been marked as a duplicate of this bug. ***

Comment 21

17 years ago
I know this is not the place to start a discussion on this item but I just 
wanted to add the following : is the loopback address, meant for local (same host) access.
'localhost' is a dns entry with is by RFC bound to, the loopback 
The number of people who intend to use address through a proxy is imho very 
small. But the possibility should exist.
'Correct' behaviour would imho be :
As soon as a user enters a proxy/choose auto proxy, should be added 
as a default in the 'no proxy for' so it can still be deleted.
'localhost' should not be added as it is bound to by default.
<i>The ".localhost" TLD has traditionally been statically defined in host DNS 
implementations as having an A record pointing to the loop back IP address and 
is reserved for such use. Any other use would conflict with widely deployed 
code which assumes this use. </i>
Of course overriding this can still be done on OS level.

I would even go as far as to copy the proxy-ip for all entries when the manual 
HTTP proxy is entered; from a user friendly use point of view

Comment 22

17 years ago
localhost has to be included in the fix because we don't do hostname -> IP
conversion when we use the "no proxy" mask, we do a string compare. There is a
bug on this somewhere...


17 years ago
Blocks: 160091

Comment 23

17 years ago
I've tested this patch to make sure it changes http://localhost and

Comment 24

17 years ago
Okay, I've checked all the dupes, moved the correct ones to Networoking,
verified them all, fixed a couple bad dupes...

Due to limitations in "no proxy for", it might trap or
other hostnames w/ localhost in it.

I also need to check how well manual over-ride works.

Comment 25

17 years ago
Okay, patched phoenix's file. oops. I'll patch the other file soon.

Turns out the behavior is this:

new profiles will show the values by default.
However, if you delete them, they will be replaced by "", and that entry in
prefs.js will never clear, so it is basically a one time seed.

Comment 26

17 years ago

Comment 27

17 years ago
Comment on attachment 101381 [details] [diff] [review]
patch for the mozilla-trunk all.js

that's not a patch!
Attachment #101381 - Attachment is obsolete: true

Comment 28

17 years ago

Comment 29

17 years ago
Comment on attachment 101383 [details] [diff] [review]
patch to all.js for mozilla-trunk


this seems like a reasonable stop-gap measure; although it will do nothing to
help out folks who have modified the no_proxies_on preference in their prefs.js
(via the proxy prefs UI).

ultimately, we need to move some checks into the nsProtocolProxyService to
always disable proxying to localhost.  we might want to pref this check as

also, there's some edge cases that this check will miss.  e.g. "xyzlocalhost"
Attachment #101383 - Flags: superreview+


17 years ago
Summary: Proxy: localhost and should be proxyable → Proxy: localhost and should be proxyable, but not by default
Comment on attachment 101383 [details] [diff] [review]
patch to all.js for mozilla-trunk

Attachment #101383 - Flags: review+

Comment 31

17 years ago
Thanks. I don't have cvs checkin for code, only Is the next step
finding someone to cvs checkin to the trunk?

Comment 32

17 years ago
I know this is late but I object to including "localhost". It is just a
string. By convention it is the name for but that's just a
convention. There's no RFC that requires that linkage. In fact, some
installations handle "localhost" in their DNS servers wher it could refer to
almost anything. This patch is based on what works on some machines not what 
is required for all machines.

Comment 33

17 years ago
Every DNS server that has "" that I have checked maps back

The underlying problem here is that noproxy just checks the URL string, so there
is no "check the IP post DNS resolution" step. If you don't trap "localhost",
you never will.

Comment 34

17 years ago
thanks to sicking for the checkin!
This should be in the trunk before the 1.2 branch, so new profiles in 1.2b and
1.2 should exhibit this as well.

Comment 35

17 years ago
Last Resolved: 19 years ago17 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.0.1 → mozilla1.2beta

Comment 36

17 years ago

Normally, I would not verify my own fix, but this was just a prefs file change.

Looked only at Mac OS X, creation of new profiles does have pre-populated "no
proxy" entries.
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.