Amazon.Runtime.ClientConfig.GetWebProxy C# (CSharp) Метод

GetWebProxy() публичный Метод

Returns a WebProxy instance configured to match the proxy settings in the client configuration.
public GetWebProxy ( ) : WebProxy
Результат System.Net.WebProxy
        public WebProxy GetWebProxy()
        {
            const string httpPrefix = "http://";

            WebProxy proxy = null;
            if (!string.IsNullOrEmpty(ProxyHost) && ProxyPort > 0)
            {
                // WebProxy constructor adds the http:// prefix, but doesn't
                // account for cases where it's already present which leads to
                // malformed addresses
                var host = ProxyHost.StartsWith(httpPrefix, StringComparison.OrdinalIgnoreCase)
                               ? ProxyHost.Substring(httpPrefix.Length)
                               : ProxyHost;
                proxy = new WebProxy(host, ProxyPort);

                if (ProxyCredentials != null)
                {
                    proxy.Credentials = ProxyCredentials;
                }
                if (ProxyBypassList != null)
                {
                    proxy.BypassList =  ProxyBypassList.ToArray();
                }
                proxy.BypassProxyOnLocal = ProxyBypassOnLocal;
            }

            return proxy;
        }

Same methods

ClientConfig::GetWebProxy ( ) : IWebProxy