[Mono-dev] [PATCH] Proxy detection under 2.0 (+ config bug?)

Michael Hutchinson m.j.hutchinson at gmail.com
Wed Nov 1 10:20:47 EST 2006

The attached patch updates/implements HTTP proxy detection for the 2.0
profile, because the the 1.1 detection code is not used with the 2.0
config system.

This patch basically does two things:
* It obsoletes GlobalProxySelection, and moves the 2.0 config code
from GlobalProxySelection to the new property WebRequest.DefaultProxy.
* It implements the UseSystemDefault config setting under the 2.0
profile using the environment variable http_proxy, using a simple
implementation of the new method WebRequest.GetSystemWebProxy (). The
1.1 code that did this isn't used by the 2.0 config system.

AFAIK, there isn't really a better way to detect the proxy settings
without adding a dependency on Gnome or Mozilla. I guess we could
attempt to poke inside their config files at runtime, but most other
tools respect http_proxy.

I can't guarantee that this exactly follows 2.0 .NET behaviour because
I don't have access to .NET right now, but at least UseSystemDefault
will work like it does in the 1.1 profile.

There is one serious problem that I have come across, that
ConfigurationSettings.GetConfig has a BREAKING CHANGE in Mono 2.0. It
no longer seems to respect machine.config. Neither do any of the
methods in ConfigurationManager as far as I can see, except those that
explicitly deal with the machine config. Unfortunately the MSDN docs
seem slightly ambiguous on whether this behaviour is expected, but
surely I shouldn't need to merge the machine and app configs

Michael Hutchinson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: settingstest.cs
Type: text/x-csharp
Size: 1672 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061101/70494c31/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20proxy.diff
Type: text/x-patch
Size: 4844 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061101/70494c31/attachment-0001.bin 

More information about the Mono-devel-list mailing list