Dela via


ProxyConfiguration.CanConnectDirectly Property

Definition

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

Note

This class property is not supported on Windows Phone.

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

TRUE if this configuration can connect directly; otherwise, FALSE.

Remarks

There may be cases where CanConnectDirectly returns false, yet it does not mean you cannot access the resource directly. A local network could be configured to have support for both a proxy and network address translation (NAT). The WPAD script used to supply proxy information to a web browser or HttpClient tells Windows that it should use the proxy. But if you disregard the policy you can still go directly through NAT. This can cause problems when the remote endpoint is not expecting a connection from a proxy.

In a UWP app, the StreamSocket class supports connecting to a remote endpoint when proxies are required to complete the connection. This support for proxies 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

See also