Ejemplo n.º 1
0
        private IRestClient createConfiguredClient(Config config)
        {
            IRestClient client = new RestClientImpl();

            client.ReadWriteTimeout = DEFAULT_READWRITE_TIMEOUT;
            if (config != null)
            {
                client.ReadWriteTimeout
                    = config.getAsInteger("http.client.connection.timeout", DEFAULT_READWRITE_TIMEOUT);
            }
            return(client);
        }
Ejemplo n.º 2
0
        private void configureProxy(Config config, IRestClient client)
        {
            string proxyHost = config.get("http.proxy.host");

            if (proxyHost != null)
            {
                int       proxyPort     = config.getAsInteger("http.proxy.port", DEFAULT_PROXY_PORT);
                string    proxyUserName = config.get("http.proxy.username");
                string    proxyPassword = config.get("http.proxy.password");
                string    proxyDomain   = config.get("http.proxy.domain");
                ProxyInfo proxyInfo
                             = new ProxyInfo(proxyHost, proxyPort, proxyUserName, proxyPassword, proxyDomain);
                client.Proxy = proxyInfo;
            }
        }