Share via


Proxy Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets proxy information for the request.

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

Syntax

'Declaration
Public Overrides Property Proxy As IWebProxy
public override IWebProxy Proxy { get; set; }
public:
virtual property IWebProxy^ Proxy {
    IWebProxy^ get () override;
    void set (IWebProxy^ value) override;
}
abstract Proxy : IWebProxy with get, set
override Proxy : IWebProxy with get, set
override function get Proxy () : IWebProxy
override function set Proxy (value : IWebProxy)

Property Value

Type: System.Net. . :: . .IWebProxy
The IWebProxy object to use to proxy the request. The default value is set by calling the GlobalProxySelection.Select property.

Remarks

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 GlobalProxySelection.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 HttpWebRequest instance will use the proxy settings specified. If no proxy is specified in a config file and the Proxy property is unspecified, the HttpWebRequest class 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 HttpWebRequest 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 HttpWebRequest class will parse a bypass list of "nt*" from Internet Explorer as a regular expression of "nt.*". So a URL of "http://nt.com" would bypass the proxy using the HttpWebRequest class and using Internet Explorer.

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

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

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

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

.NET Framework Security

See Also

Reference

HttpWebRequest Class

System.Net Namespace