Exemplo n.º 1
0
        private HttpEnvironmentProxy(Uri?httpProxy, Uri?httpsProxy, string?bypassList)
        {
            _httpProxyUri  = httpProxy;
            _httpsProxyUri = httpsProxy;

            _credentials = HttpEnvironmentProxyCredentials.TryCreate(httpProxy, httpsProxy);

            if (!string.IsNullOrWhiteSpace(bypassList))
            {
                string[]      list    = bypassList.Split(',');
                List <string> tmpList = new List <string>(list.Length);

                foreach (string value in list)
                {
                    string tmp = value.Trim();
                    if (tmp.Length > 0)
                    {
                        tmpList.Add(tmp);
                    }
                }
                if (tmpList.Count > 0)
                {
                    _bypass = tmpList.ToArray();
                }
            }
        }
        private HttpEnvironmentProxy(Uri?httpProxy, Uri?httpsProxy, string?bypassList)
        {
            _httpProxyUri  = httpProxy;
            _httpsProxyUri = httpsProxy;

            _credentials = HttpEnvironmentProxyCredentials.TryCreate(httpProxy, httpsProxy);
            _bypass      = bypassList?.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
        }