BasicHttpBinding.ProxyAddress Property

Definition

Gets or sets the URI address of the HTTP proxy.

C#
public Uri ProxyAddress { get; set; }
C#
[System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))]
public Uri ProxyAddress { get; set; }

Property Value

Uri

A Uri that serves as the address of the HTTP proxy. The default value is null.

Attributes

Examples

The following example sets ProxyAddress to application settings.

C#
// Get base address from app settings in configuration
Uri baseAddress = new Uri(ConfigurationManager.AppSettings["baseAddress"]);

BasicHttpBinding binding = new BasicHttpBinding();

binding.ProxyAddress = baseAddress;

The value of this property can also be set in the configuration file.

XML
<configuration>
  <system.serviceModel>

    <bindings>
      <basicHttpBinding>
        <binding name="Binding1"
                 proxyAddress = "http://myProxy">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

Remarks

If the UseDefaultWebProxy is set to true, the default address is used and the value of the ProxyAddress set is ignored.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0