[Mono-bugs] [Bug 691291] Incomplete proxy support/ system wide proxy bypass list is ignored

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 6 02:10:36 EDT 2011



--- Comment #6 from QuickJack . <test051102 at hotmail.com> 2011-10-06 06:10:34 UTC ---
As I said in "Comment 5", proxy settings can be configured via web.config.
Following is a simple example section which configures a proxy server and an ip
address to bypass.

        <proxy usesystemdefault="false" proxyaddress="http://my.proxy.com" />
            <add Address=""/>


(1) WebRequest.GetDefaultWebProxy() does not respect the bypass list and needs
to be extended as follows:

    [MonoTODO("Needs to respect Module, Proxy.AutoDetect, and
Proxy.ScriptLocation config settings")]
    static IWebProxy GetDefaultWebProxy ()
        DefaultProxySection sec = ConfigurationManager.GetSection
("system.net/defaultProxy") as DefaultProxySection;
        WebProxy p;

        if (sec == null)
            return GetSystemWebProxy ();

        ProxyElement pe = sec.Proxy;

        if ((pe.UseSystemDefault != ProxyElement.UseSystemDefaultValues.False)
&& (pe.ProxyAddress == null))
            p = (WebProxy) GetSystemWebProxy ();
            p = new WebProxy ();

        if (pe.ProxyAddress != null)
            p.Address = pe.ProxyAddress;

        if (pe.BypassOnLocal != ProxyElement.BypassOnLocalValues.Unspecified)
            p.BypassProxyOnLocal = (pe.BypassOnLocal ==

        //process bypass list
        foreach(BypassElement elem in sec.BypassList)

        return p;
        return GetSystemWebProxy ();

(2) System.ConfigurationException because of typo in

Line 61 in ProxyElement.cs needs to be changed as follows;
useSystemDefaultProp = new ConfigurationProperty ("usesystemdefault", typeof
(UseSystemDefaultValues), UseSystemDefaultValues.Unspecified);

According to MSDN the property should read "usesystemdefault" and NOT

(3) System.ConfigurationException because of typo in

Line 52 in BypassElement.cs needs to be changed as follows:
addressProp = new ConfigurationProperty ("address", typeof (string), null,
ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);

According to MSDN the property should read "address" and NOT "Address"

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list