Re: Java proxies connection to postgres

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: - <grandebuzon(at)gmail(dot)com>
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Java proxies connection to postgres
Date: 2010-08-09 10:53:57
Message-ID: AANLkTimWGZAAKzcTP=DYkYyqJ+6QQcvokmvuCn1o_-Ke@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, Aug 9, 2010 at 6:34 AM, - <grandebuzon(at)gmail(dot)com> wrote:
> Thanks for answering.
> I planned to use free public proxy, which supports HTTPS
>
>             //free public proxy finded in google.com
>             System.setProperty("http.proxyHost", "189.19.44.164");
>             System.setProperty("http.proxyPort", "3128");
>
>             String url = "jdbc:postgresql://ipPublica:5432/DataBaseName";
>             Properties props = new Properties();
>             props.setProperty("user","User");
>             props.setProperty("password","Pass");
>
>             Class.forName("org.postgresql.Driver");
>
>             Connection  connection = DriverManager.getConnection(url,
> props);
>
> With this code I got to connect to postgres en server machine, but it fails
> in client machine whith firewall  :(
> With that error
>
> org.postgresql.util.PSQLException: Connection refused. Verify that the
> hostname and port are correct and that the postmaster is accepting TCP / IP.
> at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
> (ConnectionFactoryImpl.java: 136)
> at org.postgresql.core.ConnectionFactory.openConnection
> (ConnectionFactory.java: 66)
> at org.postgresql.jdbc2.AbstractJdbc2Connection. <init>
> (AbstractJdbc2Connection.java: 125)
> at org.postgresql.jdbc3.AbstractJdbc3Connection. <init>
> (AbstractJdbc3Connection.java: 30)
> at org.postgresql.jdbc3g.AbstractJdbc3gConnection. <init>
> (AbstractJdbc3gConnection.java: 22)
> at org.postgresql.jdbc4.AbstractJdbc4Connection. <init>
> (AbstractJdbc4Connection.java: 30)
> at org.postgresql.jdbc4.Jdbc4Connection. <init> (Jdbc4Connection.java: 24)
> at org.postgresql.Driver.makeConnection (Driver.java: 393)
> at org.postgresql.Driver.connect (Driver.java: 267)
>
>
>
>

These proxies are setup to proxy port 80 and port 443, They have no
knowledge of port 5432.

Dave

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Donald Fraser 2010-08-09 11:47:18 Re: Java proxies connection to postgres
Previous Message - 2010-08-09 10:34:26 Re: Java proxies connection to postgres