longhua828 / jcouchdb

Automatically exported from code.google.com/p/jcouchdb
Other
0 stars 0 forks source link

Unable to connect to database through a proxy server #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a couch on couchone from behind a http proxied firewall
2. Write a test client configured to use that couch
3. Wail till the cows come home or connection timeout whichever is first

What is the expected output? What do you see instead?

I would expect that the driver would pick up the standard Java proxy system 
properties e.g. http.proxyHost and http.proxyPort and configure the HttpClient 
with them

What version of the product are you using? On what operating system?
1.0.1 on Ubuntu 10.04

Please provide any additional information below.

I use this snippet in another client :

       proxy = new HttpClient();
        proxy.getHostConfiguration().setHost(url.getHost());
        setProxy();
    }

    private void setProxy() {
        Properties props = System.getProperties();
        if (props.containsKey("http.proxyHost")) {
            final int port =
                Integer.parseInt(props.getProperty("http.proxyPort", "8080"));
            final String host = props.getProperty("http.proxyHost");
            proxy.getHostConfiguration().setProxy(host, port);
        }
    }

Original issue reported on code.google.com by snamellit@gmail.com on 1 Oct 2010 at 12:31

GoogleCodeExporter commented 9 years ago
I patched the ServerImpl to use the standard settings for a http proxy. No 
support for https or authenticated proxies.

Original comment by snamellit@gmail.com on 1 Oct 2010 at 1:18

Attachments: