JDK-6370908 : Add support for HTTP_CONNECT proxy in Socket class
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2006-01-10
  • Updated: 2013-10-29
  • Resolved: 2013-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b82Fixed
Description
A DESCRIPTION OF THE REQUEST :
Currently the Socket(Proxy) constuctor only accepts SOCKS and DIRECT proxies. It would be very useful if HTTP type proxy sockets could be constructed.

JUSTIFICATION :
Many corporations use HTTP proxies as a part of their firewall strategy.  An easy way to construct a socket connection through an HTTP proxy would remove a significant obstacle for building LAN to WAN Java socket applications.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Socket(Proxy) constructor accept HTTP type proxy objects so that a socket connection can be successfully negociated through an HTTP proxy
ACTUAL -
If an HTTP proxy object is passed to Socket(Proxy) an IllegalArgumentException: Invalid Proxy is thrown. This is by design since HTTP proxy objects are not handled.

---------- BEGIN SOURCE ----------
Proxy httpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("myhost", 8080));
Socket socket = new Socket(httpProxy);
// BOOM! HTTP proxy object is not supported by design.
---------- END SOURCE ----------

Comments
SQE verified, the attached regression test "HttpProxy.java" reflect the problem and the test itself has not been failed for more then 2 weeks.
29-10-2013

EVALUATION This is a request to allow sockets to tunnel through HTTP proxy servers using the CONNECT method. We will look at it for dolphin. *** (#1 of 1): [ UNSAVED ] ###@###.###
11-01-2006