Exemple #1
0
        public static CFProxy[] GetProxiesForUri(Uri uri, CFProxySettings proxySettings)
        {
            if (uri == null)
            {
                throw new ArgumentNullException("uri");
            }

            CFUrl url = CFUrl.Create(uri.AbsoluteUri);

            if (url == null)
            {
                return(null);
            }

            CFProxy[] proxies = GetProxiesForURL(url, proxySettings);
            url.Dispose();

            return(proxies);
        }
Exemple #2
0
        public static CFProxy[] GetProxiesForAutoConfigurationScript(IntPtr proxyAutoConfigurationScript, Uri targetUri)
        {
            if (proxyAutoConfigurationScript == IntPtr.Zero)
            {
                throw new ArgumentNullException("proxyAutoConfigurationScript");
            }

            if (targetUri == null)
            {
                throw new ArgumentNullException("targetUri");
            }

            CFUrl targetURL = CFUrl.Create(targetUri.AbsoluteUri);

            CFProxy[] proxies = GetProxiesForAutoConfigurationScript(proxyAutoConfigurationScript, targetURL);
            targetURL.Dispose();

            return(proxies);
        }