System.Net.IWebProxy Interface

public interface IWebProxy

Assembly

System

Library

Networking

Summary

Defines the methods and properties required by types that support accessing hosts via proxy servers.

Description

[Note: This interface is implemented by the WebRequest type.]

See Also

System.Net Namespace

Members

IWebProxy Methods

IWebProxy.GetProxy Method
IWebProxy.IsBypassed Method

IWebProxy Properties

IWebProxy.Credentials Property


IWebProxy.GetProxy Method

Uri GetProxy(Uri destination);

Summary

Returns the Uniform Resource Identifier (URI) of a proxy server.

Parameters

destination
A Uri specifying the requested Internet resource.

Return Value

A Uri instance containing the URI of the proxy used to contact destination.

Description

[Behaviors: The System.Net.IWebProxy.GetProxy(System.Uri) method returns the URI of the proxy server that handles requests to the Internet resource specified in the destination parameter.]

[Usage: Use this method to get the URI of the proxy server used to access the specified resource. ]

See Also

System.Net.IWebProxy Interface, System.Net Namespace

IWebProxy.IsBypassed Method

bool IsBypassed(Uri host);

Summary

Returns a Boolean value that indicates whether the proxy server is not used to access a specified server.

Parameters

host
The Uri of the server to check for proxy use.

Return Value

true if the proxy server is not used to access the server specified in host; otherwise, false .

Description

[Behaviors: The value returned by the System.Net.IWebProxy.IsBypassed(System.Uri) method indicates whether requests that access the server specified in the host parameter bypass the proxy server. ]

[Usage: If System.Net.IWebProxy.IsBypassed(System.Uri) is true , requests and responses between the client and host are not required to go through the proxy server.]

See Also

System.Net.IWebProxy Interface, System.Net Namespace

IWebProxy.Credentials Property

ICredentials Credentials { get; set; }

Summary

Gets or sets the credentials to submit to the proxy server for authentication.

Property Value

A ICredentials instance that contains the credentials needed to authenticate a request to the proxy server.

Description

[Behaviors: The ICredentials instance set and returned by the System.Net.IWebProxy.Credentials property contains the credentials that are sent to the proxy server in response to an HTTP 407 (System.Net.HttpStatusCode.ProxyAuthenticationRequired ) status code.]

[Usage: Use this property to set the credentials supplied in response to HTTP 407 status code messages.]

See Also

System.Net.IWebProxy Interface, System.Net Namespace