WebProxy.IsBypassed Method (Uri)

 

Indicates whether to use the proxy server for the specified host.

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

abstract IsBypassed : 
        host:Uri -> bool
override IsBypassed : 
        host:Uri -> bool

Parameters

host
Type: System.Uri

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

Return Value

Type: System.Boolean

true if the proxy server should not be used for host; otherwise, false.

Exception Condition
ArgumentNullException

The host parameter is null.

The IsBypassed method is used to determine whether to bypass the proxy server when accessing an Internet resource.

The BypassProxyOnLocal and BypassList properties control the return value of the IsBypassed method.

IsBypassed returns true under any of the following conditions:

  • If BypassProxyOnLocal is true and host is a local URI. Local requests are identified by the lack of a period (.) in the URI, as in "http://webserver/".

  • If host matches a regular expression in BypassList.

  • If Address is null.

All other conditions return false.

The following code example creates a WebProxy object and calls this method to check whether the bypass list is properly set.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: