Esempio n. 1
0
        public static bool IsEmpty(this IWebProxy proxy)
        {
            if (proxy is null)
            {
                return(true);
            }

            return(string.IsNullOrWhiteSpace(proxy.GetProxyString()));
        }
        public CurlCommandLineArgumentsBuilder WithProxy(IWebProxy proxy, Uri requestUri = null)
        {
            // Argument should be of the following form:
            // -x, --proxy <[protocol://][user:password@]proxyhost[:port]>

            if (requestUri is null)
            {
                requestUri = uri;
            }

            if (!(proxy is null) && !proxy.IsBypassed(requestUri))
            {
                AddArgument("--proxy", proxy.GetProxyString(requestUri));
            }

            return(this);
        }
Esempio n. 3
0
 public static string GetProxyString(this IWebProxy proxy)
 {
     return(proxy.GetProxyString(new Uri("http://example.com")));
 }