title: Get the URI from the default web proxy
body: <p>I'm writing a program that should work without proxy and with proxy with authentication - automatically! It should call a WCF service. In this example the instance is called <code>client</code>. I also use a self written class (<code>proxyHelper</code>) that requests the credentials.</p>
  
  <pre><code> BasicHttpBinding connection = client.Endpoint.Binding as BasicHttpBinding;&lt;br/&gt;
   connection.ProxyAddress = _???_&lt;br/&gt;
   connection.UseDefaultWebProxy = false;&lt;br/&gt;
   connection.BypassProxyOnLocal = false;&lt;br/&gt;
   connection.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic;&lt;br/&gt;
   client.ClientCredentials.UserName.UserName = proxyHelper.Username;
   client.ClientCredentials.UserName.Password = proxyHelper.Password;
  </code></pre>
  
  <p>I'm facing a problem getting the ProxyAddress. If I use <code>HttpWebRequest.GetSystemWebProxy()</code> to get actual defined proxy I see in debug mode the <em>correct</em> proxy address but it's a non public property. Setting UseDefaultWebProxy to true doesn't work and if I add the proxy address hard-coded and set the UseDefaultWebProxy to false it works fine. So... how can I gather the address of the default web proxy?</p>