Message-ID: From: "jkutner (@jkutner)" To: "pgjdbc/pgjdbc" Date: Fri, 06 Oct 2017 04:46:56 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #975: Version from 42.1.0 can't connect to 127.0.0.1 with System SOCKS proxy In-Reply-To: References: List-Id: X-GitHub-Author-Login: jkutner X-GitHub-Comment-Id: 334657301 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 975 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/975#issuecomment-334657301 Content-Type: text/plain; charset=utf-8 @jorsol thanks for the ping. I can make a patch quickly if that is preferable to reverting. however, I'm unsure of the best solution. I think we have three options: * Explicitly check for `localhost`, or `127.0.0.1` and disable the [deferred host resolution](https://github.com/pgjdbc/pgjdbc/blob/acff9495b8745bce30d93d61e77caf81d9748b4b/pgjdbc/src/main/java/org/postgresql/core/PGStream.java#L66-L68). * Attempt to resolve the hostname if the deferred resolution fails (i.e. try to resolve the hostname with `new InetSocketAddress` if `socket.connect` fails). * Add an option to explicitly disable the deferred resolution (i.e. never use the socks proxy). How do other libraries/frameworks deal with `localhost` and a `socksProxyHost`? There might be a precedent.