This documentation is archived and is not being maintained.

GlobalProxySelection Class

Contains a global default proxy instance for all HTTP requests.

For a list of all members of this type, see GlobalProxySelection Members.


[Visual Basic]
Public Class GlobalProxySelection
public class GlobalProxySelection
public __gc class GlobalProxySelection
public class GlobalProxySelection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


The GlobalProxySelection stores the proxy settings for the default proxy that WebRequest instances use to contact Internet sites beyond the local network. The default proxy setting is initialized from the global or application configuration file, and can be overridden for individual requests, or disabled by setting the HttpWebRequest.Proxy property to the result of the GetEmptyWebProxy method.

The proxy settings stored in GlobalProxySelection are used by any HttpWebRequest instances whose Proxy property is not set to another value.

Note   Changes to the GlobalProxySelection after a request is made are not reflected in a WebRequest.


[Visual Basic, C#, C++] The following example sets the GlobalProxySelection for an HTTP proxy named "webproxy" on port 80.

[Visual Basic] 
Dim proxyURI As New Uri("http://webproxy:80")
GlobalProxySelection.Select = New WebProxy(proxyURI)

Uri proxyURI = new Uri("http://webproxy:80");
 GlobalProxySelection.Select = new WebProxy(proxyURI);

Uri* proxyURI = new Uri(S"http://webproxy:80");
 GlobalProxySelection::Select = new WebProxy(proxyURI);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Namespace: System.Net

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

GlobalProxySelection Members | System.Net Namespace