System.Net.WebProxy.GetProxy Method

Returns the proxied URI for a request.

Syntax

public Uri GetProxy (Uri destination)

Parameters

destination
The Uri instance of the requested Internet resource.

Returns

The Uri instance of the Internet resource, if the resource is on the bypass list; otherwise, the Uri instance of the proxy.

Remarks

The WebProxy.GetProxy(Uri) method returns the URI that the System.Net.WebRequest instance uses to access the Internet resource.

WebProxy.GetProxy(Uri) compares destination with the contents of WebProxy.BypassList, using the WebProxy.IsBypassed(Uri) method. If WebProxy.IsBypassed(Uri) returns true, WebProxy.GetProxy(Uri) returns destination and the System.Net.WebRequest instance does not use the proxy server.

If destination is not in WebProxy.BypassList, the System.Net.WebRequest instance uses the proxy server and the WebProxy.Address property is returned.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0