For configuration inspection in an existing .NET Framework ASP.NET application, read system.net/defaultProxy through the configuration API:

using System.Net.Configuration;
using System.Web.Configuration;

var section = WebConfigurationManager.GetSection(
    "system.net/defaultProxy") as DefaultProxySection;

if (section != null)
{
    bool enabled = section.Enabled;
    var configuredAddress = section.Proxy.ProxyAddress;
    bool useDefaultCredentials = section.UseDefaultCredentials;
}

The returned values describe the configuration section, including applicable inherited configuration and defaults. They are useful when displaying or auditing the application’s selected configuration.

A literal ProxyAddress is different from a proxy selected for a destination. An automatic policy can choose another route for each URL, and a request can also carry its own explicit proxy configuration.

Use IWebProxy.GetProxy(destination) when the question is the policy’s decision for that destination. Use DefaultProxySection when the question is what the configuration declares. An empty literal address is not by itself evidence that every request goes directly.

འབྲེལ་བའི་རྩོམ་ཡིག