ProxyConfiguration
ProxyConfiguration
ProxyConfiguration
ProxyConfiguration
Class
Definition
Represents the proxy configuration for the current user.
Note
This class is not supported on Windows Phone.
public : sealed class ProxyConfiguration : IProxyConfigurationpublic sealed class ProxyConfiguration : IProxyConfigurationPublic NotInheritable Class ProxyConfiguration Implements IProxyConfiguration// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
| Capabilities |
privateNetworkClientServer
internetClient
|
Remarks
A ProxyConfiguration object is returned by calling the GetProxyConfigurationAsync method on the NetworkInformation object. If the GetProxyConfigurationAsync method is successful, the IAsyncOperation(ProxyConfiguration) handler for the method is passed a ProxyConfiguration object.
The proxy configuration returned is for the uri parameter passed to the GetProxyConfigurationAsync 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
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 : PlatForm::Boolean CanConnectDirectly { get; }public bool CanConnectDirectly { get; }Public ReadOnly Property CanConnectDirectly As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean 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 IReadOnlyList<Uri> ProxyUris { get; }Public ReadOnly Property ProxyUris As IReadOnlyList<Uri>// You can use this property in JavaScript.
- Value
- IVectorView<Uri> IReadOnlyList<Uri> IReadOnlyList<Uri> IReadOnlyList<Uri>
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.