Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WebProxy.BypassProxyOnLocal Property

Gets or sets a value that indicates whether to bypass the proxy server for local addresses.

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

public:
property bool BypassProxyOnLocal {
	bool get ();
	void set (bool value);
}
/** @property */
public boolean get_BypassProxyOnLocal ()

/** @property */
public void set_BypassProxyOnLocal (boolean value)

public function get BypassProxyOnLocal () : boolean

public function set BypassProxyOnLocal (value : boolean)

Not applicable.

Property Value

true to bypass the proxy server for local addresses; otherwise, false. The default value is false.

The setting of the BypassProxyOnLocal property determines whether WebRequest instances use the proxy server when accessing local Internet resources.

If BypassProxyOnLocal is true, requests to local Internet resources do not use the proxy server. Local requests are identified by the lack of a period (.) in the URI, as in http://webserver/, or access the local server, including http://localhost, http://loopback, or http://127.0.0.1. When BypassProxyOnLocal is false, all Internet requests are made through the proxy server.

NoteNote:

Requests to a local host with a URI that contain a period use the proxy. To avoid using a proxy in these cases, create an entry for the host in the BypassList.

The following code example demonstrates calling a constructor that sets this property and getting the value of this property.

WebProxy^ CreateProxyWithHostAddress( bool bypassLocal )
{
   WebProxy^ proxy = gcnew WebProxy( "http://contoso",bypassLocal );
   Console::WriteLine( "Bypass proxy for local URIs?: {0}", 
      proxy->BypassProxyOnLocal );
   return proxy;
}

public static WebProxy CreateProxyWithHostAddress(boolean bypassLocal)
{
    WebProxy proxy = new WebProxy("http://contoso", bypassLocal);
    Console.WriteLine("Bypass proxy for local URIs?: {0}", 
        (System.Boolean)proxy.get_BypassProxyOnLocal());
    return proxy;
} //CreateProxyWithHostAddress

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.