Proxy Bypassing Behavior

The HTTP transport and binding element have three settings for controlling the proxy behavior.

 public bool BypassProxyOnLocal { get; set; }
public Uri ProxyAddress { get; set; }
public bool UseDefaultWebProxy { get; set; }

UseDefaultWebProxy controls whether manual proxy settings are used or whether the automatically-configured system proxy settings are used. ProxyAddress is how you manually specify the proxy. If you're using the automatically-configured proxy, then you can't also specify a manual proxy address. Finally, BypassProxyOnLocal allows you to control whether the proxy is used for destination addresses that are on your local network.

Requests to any loopback adapter address or the special host name localhost are always bypassed. Even if you set BypassProxyOnLocal to false, requests to these addresses will still not go through the proxy. Unfortunately, overriding this behavior would require writing a custom instance of IWebProxy and attaching that proxy to the underlying web requests that are being made. It's more common to hit this problem during development when you're testing on a machine that doesn't have the same networking setup that the real server will have. One workaround is to install a virtual network adapter that performs loopback in software. This allows you to send requests to an address that is not classified as a loopback without having to add new hardware to your system.

Next time: Registration of Base Addesses