HttpTransportBindingElement.BypassProxyOnLocal 属性
定义
获取或设置一个值,该值指示是否为本地地址忽略代理。Gets or sets a value that indicates whether proxies are ignored for local addresses.
public:
property bool BypassProxyOnLocal { bool get(); void set(bool value); };
public bool BypassProxyOnLocal { get; set; }
member this.BypassProxyOnLocal : bool with get, set
Public Property BypassProxyOnLocal As Boolean
属性值
如果为本地地址忽略代理,则为 true;否则为 false。true if proxies are ignored for local addresses; otherwise, false. 默认值为 false。The default is false.
示例
下面的示例将此属性设置为在对绑定执行请求时使用。The following example sets this property to use when performing requests on the binding.
HttpTransportBindingElement httpBinding = new HttpTransportBindingElement();
httpBinding.BypassProxyOnLocal = true;
注解
本地地址是指位于本地 LAN 或 Intranet 上的地址。A local address is one that is on the local LAN or intranet.
如果服务地址以开头,WCF 将始终忽略代理 http://localhost 。WCF always ignores the proxy if the service address begins with http://localhost. 如果希望客户端在与同一台计算机上的服务通话时使用代理,则应使用主机名称而非 localhost。You should use the host name (rather than localhost) if you want clients to go through a proxy when talking to services on the same machine.