How to Get the proxy server address?

Configuring a proxy-server for WCF

Configuring a proxy-server for WCFDefault configuration for WCF service/client bindings is to use the default web proxy (the proxy-settings as configured in Internet Explorer).
To configure a proxy for a specific client/service endpoint, you can configure this on the binding that is used by the endpoint, eg:

This also works for custom bindings, eg:

It's also possible to configure the default webproxy in the app.config itself and leave all bindings unmodified. In this case, you may want to specify that local addresses should, or should not bypass the proxy-server, eg:

This all works pretty transparent, but today I ran into some strange behavior: I wanted to inspect the HTTP-requests my client sent using Fiddler, but no matter how or where I configured the proxy-settings, they didn't seem to have any effect at all; WCF always bypassed the proxy. After reading lots of forums/blogs/etc, I finally found out the reason: I used localhost in the endpoint address!
It turned out that when localhost is used as the target machine name in the endpoint address, WCF/System.Net itself decides to ignore proxy-settings (probably for internal routing/performance reasons). After using the actual machinename in the address, everything suddendly worked like a charm!

Since Fiddler automatically registers itself as the default web proxy (in IE) on startup, I didn't have to configure anything in WCF at all to get things working, as long as I didn't use localhost in the endpoint-addresses.


Related posts:

  1. How to Find proxy server IP address?
  2. Where to Get proxy server address?
  3. How to Know my proxy server address?