HttpClientHandler.Proxy Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets proxy information used by the handler.

Namespace:   System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

member Proxy : IWebProxy with get, set

Property Value

Type: System.Net.IWebProxy

The proxy information used by the handler. The default value is null.

The Proxy property identifies the WebProxy object to use to process requests to Internet resources. To specify that no proxy should be used, set the Proxy property to the proxy instance returned by the GetEmptyWebProxy method.

The local computer or application config file may specify that a default proxy be used. If the Proxy property is specified, then the proxy settings from the Proxy property override the local computer or application config file and the handler will use the proxy settings specified. If no proxy is specified in a config file and the Proxy property is unspecified, the handler uses the proxy settings inherited from Internet Explorer on the local computer. If there are no proxy settings in Internet Explorer, the request is sent directly to the server.

The HttpClientHandler class parses a proxy bypass list with wildcard characters inherited from Internet Explorer the same as the bypass list is parsed directly by Internet Explorer. For example, the HttpClientHandler class will parse a bypass list of "nt*" from Internet Explorer as a regular expression of "nt.*". So a URL of "" would bypass the proxy using the HttpClientHandler class and using Internet Explorer.

The HttpClientHandler class supports local proxy bypass. The class considers a destination to be local if any of the following conditions are met:

  1. The destination contains a flat name (no dots in the URL).

  2. The destination contains a loopback address (Loopback or IPv6Loopback) or the destination contains an IPAddress assigned to the local computer.

  3. The domain suffix of the destination matches the local computer's domain suffix (DomainName).

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top