ProxyConfiguration ProxyConfiguration ProxyConfiguration ProxyConfiguration Class

Represents the proxy configuration for the current user.

Note

This class is not supported on Windows Phone.

Syntax

Declaration

public sealed class ProxyConfigurationpublic sealed class ProxyConfigurationPublic NotInheritable Class ProxyConfigurationpublic sealed class ProxyConfiguration

Remarks

A ProxyConfiguration object is returned by calling the GetProxyConfigurationAsync(Uri) method on the NetworkInformation object. If the GetProxyConfigurationAsync(Uri) method is successful, the IAsyncOperation<TResult> handler for the method is passed a ProxyConfiguration object.

The proxy configuration returned is for the uri parameter passed to the GetProxyConfigurationAsync(Uri) method. The uri parameter contains a hostname or IP address for the target endpoint and a service name, port number, or protocol scheme.

In a Windows Store app, the StreamSocket class supports connecting to a remote endpoint when proxies are required to plumb 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.

Properties summary

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

Note

This class property is not supported on Windows Phone.

Gets a list of URIs for the proxies from the proxy configuration.

Note

This class property is not supported on Windows Phone.

Properties

  • CanConnectDirectly
    CanConnectDirectly
    CanConnectDirectly
    CanConnectDirectly

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

    Note

    This class property is not supported on Windows Phone.

    public bool CanConnectDirectly { get; }public bool CanConnectDirectly { get; }Public ReadOnly Property CanConnectDirectly As boolpublic bool CanConnectDirectly { get; }

    Property Value

    • bool
      bool
      bool
      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 Windows Store 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.

  • ProxyUris
    ProxyUris
    ProxyUris
    ProxyUris

    Gets a list of URIs for the proxies from the proxy configuration.

    Note

    This class property is not supported on Windows Phone.

    public IVectorView<Uri> ProxyUris { get; }public IVectorView<Uri> ProxyUris { get; }Public ReadOnly Property ProxyUris As IVectorView<Uri>public IVectorView<Uri> ProxyUris { get; }

    Property Value

    • A list of URIs for the proxy configuration.

    Remarks

    The Web Proxy Auto-Discovery Protocol (WPAD) is used by web browsers and other apps to locate a proxy configuration file. This proxy auto-config (PAC) file defines the proxy server that should be used to retrieve a specific URI or whether to bypass the proxy for certain URIs. The PAC allows different proxies to be defined for different URIs.

    The ProxyUris property contains a list of URIs that an app should connect directly to and bypass the proxy.

    In a Windows Store 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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

privateNetworkClientServer
internetClient

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Networking.Connectivity.dll