Share via


ProxyConfiguration.CanConnectDirectly Property

Definition

Gets a value that indicates whether this configuration can connect directly.

public:
 property bool CanConnectDirectly { bool get(); };
bool CanConnectDirectly();
public bool CanConnectDirectly { get; }
var boolean = proxyConfiguration.canConnectDirectly;
Public ReadOnly Property CanConnectDirectly As Boolean

Property Value

Boolean

bool

Returns true when this configuration can connect directly; otherwise, false.

Remarks

There may be cases where CanConnectDirectly returns false, yet the resource remains reachable directly. A local network can support both a proxy and network address translation (NAT). The WPAD script used to supply proxy information to a web browser or HttpClient tells Windows to use the proxy. Disregarding that policy and going directly through NAT can cause problems when the remote endpoint is not expecting a proxy-less connection.

In a UWP app, the StreamSocket class supports connecting to a remote endpoint when proxies are required to complete the connection. This proxy support is automatic and transparent to the app. For more detailed information, see the remarks on Support for proxies in the StreamSocket class reference.

Applies to