Proxy element of machine.config and locally defined hosts

  • Thread starter Thread starter David Swanson
  • Start date Start date
D

David Swanson

I am trying to configure the proxy section of the
machine.config to handle BOTH connecting to hosts that
are
not "live" but rather defined in my
winnt/system32/drivers/etc/hosts file. AND to hosts that
are "live" and must go through our proxy server.

The problem is I cannot find a configuration that works
for both. I am trying to load an xmldoc using
XMLDocument.Load(url)

This works for my locally defined hosts (provided my
internet options have put in a proxy exclude) but will
not
connect to live hosts required to go through the proxy:

<proxy
usesystemdefault = "true"
/>

This works for live hosts, but fails on all my locally
defined hosts (I changed the proxyaddress for the
example):

<proxy
usesystemdefault = "false"
proxyaddress = "http://myproxy.myfirm.com:80"
bypassonlocal = "true"
Is there some configuration to support both or a place
where I would have to define my hosts for .Net rather
than
in winnt/system32/drivers/etc/hosts ?

Thanks, David
 
Sorry, I should have mentioned that in my first post. I
did have the local hosts (those in .../etc/hosts) in the
bypasslist element at one point, but it did not make a
difference. For example, If I had a host 187.432.23.12
devbox1 defined in ../etc/hosts and the following
machine.config, I could not connect to the
url "admin.devbox1.com", but all live hosts are fine. I
assumed that this is because even though it is in the
bypass list, .net is unaware of my hosts in ../etc/hosts.

<defaultProxy>
<proxy
usesystemdefault = "false"
proxyaddress = "http://webproxy.int.westgroup.com:80"
bypassonlocal = "true"
/>
<bypasslist>
<add address="http://[a-z]+\.devbox1\.com/" />
<add address="http://devbox1\.lawoffice\.com/" />
</bypasslist>
</defaultProxy>

-Thanks, David
 
Back
Top