Bugfix for JDK API, using proxies

A bug caused the connection to be set up to the proxy URI rather than the request URI.