System.Net.ServicePointManager.ProxyAddressIfNecessary C# (CSharp) Method

ProxyAddressIfNecessary() private static method

private static ProxyAddressIfNecessary ( Uri &address, IWebProxy proxy ) : bool
address System.Uri
proxy IWebProxy
return bool
        private static bool ProxyAddressIfNecessary(ref Uri address, IWebProxy proxy)
        {
            if (proxy != null && !address.IsLoopback)
            {
                Uri proxyAddress = proxy.GetProxy(address);
                if (proxyAddress != null)
                {
                    if (proxyAddress.Scheme != Uri.UriSchemeHttp)
                    {
                        throw new NotSupportedException(SR.Format(SR.net_proxyschemenotsupported, address.Scheme));
                    }

                    address = proxyAddress;
                    return true;
                }
            }

            return false;
        }