GNOME Bugzilla – Bug 113222
Allow some hosts to not use the proxy
Last modified: 2004-12-22 21:47:04 UTC
As part of bug #112979, a new key is going to be added to gconf (/system/http_proxy/ignore_hosts). This key is a list of strings containing hostnames and IP addresses that should be connected to directly, rather than via the specified proxy. By default, the key will contain localhost and 127.0.0.0/8. The patch attached to this bug report allows Epiphany to process this key and pass it to gtkmozembed for retrieving web pages. The simplest way to test this patch is to run: gconftool-2 --type=list --list-type=string --set /system/http_proxy/ignore_hosts [localhost,127.0.0.0/8] (all on one line), configure a web browser to talk to a proxy and then browser http://localhost/ from a machine that is not the proxy. Without the patch, this browsing will not work. With the patch, it correctly connects directly to the local machine. Note that the patch that is coming in the #112979 will correctly handle IPv6 addresses as well and things are stored in the same format that mozilla expects them, so IPv4 and IPv6 will both work transparently.
Created attachment 16606 [details] [review] Allow proxy-ignorable hosts.
It looks good, but I guess we need to reset mozilla pref to "" when there the list is NULL ?
Malcolm, Epiphany already has a #define CONF_NETWORK_NO_PROXIES_FOR "/apps/epiphany/network/no_proxies_for" That has an associated schema entry. If your patch obsoletes this key, can you remove it from the schema as well as from the code?
With regards to Marco's comment, yes you are correct: I will fix the patch. The "if (!hosts)..." portion can be removed and it should Just Work(tm), I think. I will look at this further. With regards to the gconf key: I had not noticed that there was already a gconf key to do this. I think we still need to use the key I am proposing so that it fits in with what the control-center will be setting, etc. Do you want to obsolete the CONF_NETWORK_NO_PROXIES_FOR key, which will have the side-effect of temporarily breaking the setup for people who have found this hidden preference? Or do you want to use that key as a fallback (if ignore_hosts is set, use that, otherwise use the old key)? I would suggest going with the latter option, at least until a new control-center is in wide-spread use that allows the ignorable hosts to be set via a UI, rather than with gconftool.
>I would suggest going with the latter >option, at least until a new control-center is in wide-spread use that >allows the ignorable hosts to be set via a UI, rather than with gconftool. Well my personal stance is that we are targetting gnome 2.4, and that in most cases its fair for us to expect users to have this setup if they want a fully supported app. Forcing the user to search for a hidden control center key is really no worst than forcing them to search for hidden epihpany key. Also i see a point of confusion if users edit keys via gconfeditor for instance. They might set the existing epiphany key and wonder why it doesn't work. Perhaps for the time being we should keep the key but i think in the final shipped version of epiphany we should remove both the key from the schema and the internals. I'd really like us to have a clean schema file with only prefs that we plan to support for a long time. It makes the use of gconf editor much easier since we limit the amount of cruft that is listed that actually does nothing. Of course this is just my opinion, and the final decision is up to marco.
Fair enough. By the way, to give you an idea of the timing on getting everything together here: the gnome-vfs change that is relevant here (the important bit being the schema change to initialise the key) is about a day away from being submitted. The control-center change is a day or two away (I will be debugging it this evening). So people won't have to poke around with gconftool for very long. In view of the time frame, you may decide to hold off on this patch until the control-center patch is available (bug #44098). Note also (and this pseudo-usability wart may affect your timing) that the new key is a list of strings, not a string, so setting it cannot be done via gconf-editor, you need to use gconftool-2. Using a string would be nicer for reading in epiphany and galeon, but introduces difficulties elsewhere (wherever you need to parse it into components).
according to philip in bug 113221, the old pref wasn't being respected anyway at least in galeon. If this is true for ephy as well (i assume it is but marco would know better) we should probably just kill it.
I (somewhat heretically) doubt Philip's comment, though. It looks to me like you were right initially. In epiphany/embed/mozilla/mozilla-notifiers.cpp, look at the conversion_table array. It maps CONF_NETWORK_NO_PROXIES_FOR from epiphany onto the mozilla network.proxy.no_proxies_on preference (since they are both in the same format).
Created attachment 16616 [details] [review] Updated version of previous patch, taking into account all comments so far
Looks cool. Please commit this with the others patches. Thanks a lot !
Marking 1.0 assuming all the other patches get into gnome 2.4
The gnome-vfs patch didn't make it before the feature freeze, and I tend to consider it as a feature. If you really need it in epiphany, we could check with the release team what they think about it, imo it's too late for it :(
But alex gave his ok to commit before the freeze, no ? I'm not sure what's the status/complexity of the patch, I guess this should be discussed with release team. A possible solution would be to just install the key I guess and let people configure it with gconf-editor. Better than nothing.
That was after the "official" freeze, but before the postponed freeze, but I think what counts is the commit of the patch, not its approval :) If you want it in, I'll let you discuss that issue with the release team :)
Created attachment 18453 [details] [review] Updated patch (it did not apply cleanly anymore)
Created attachment 18996 [details] [review] safer and respecting schemas patch
checked in
Unset milestone so I can remove them. Sorry for the spam.