Redigera

Dela via


BasicHttpBinding.ProxyAddress Property

Definition

Gets or sets the URI address of the HTTP proxy.

public:
 property Uri ^ ProxyAddress { Uri ^ get(); void set(Uri ^ value); };
public Uri ProxyAddress { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))]
public Uri ProxyAddress { get; set; }
member this.ProxyAddress : Uri with get, set
[<System.ComponentModel.TypeConverter(typeof(System.UriTypeConverter))>]
member this.ProxyAddress : Uri with get, set
Public Property ProxyAddress As Uri

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.

// 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.

<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