<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy
usesystemdefault="True"
proxyaddress="http://127.X.X.X:8080"
bypassonlocal="True"
/>
</defaultProxy>
</system.net>
namespace SomeNameSpace
{
public class MyProxy : IWebProxy
{
public ICredentials Credentials
{
get { return new NetworkCredential("user", "password"); }
//or get { return new NetworkCredential("user", "password","domain"); }
set { }
}
public Uri GetProxy(Uri destination)
{
return new Uri("http://my.proxy:8080");
}
public bool IsBypassed(Uri host)
{
return false;
}
}
}
<defaultProxy enabled="true" useDefaultCredentials="false">
<module type = "SomeNameSpace.MyProxy, SomeAssembly" />
</defaultProxy>
Kaynak: https://stackoverflow.com/questions/186800/is-it-possible-to-specify-proxy-credentials-in-your-web-config#