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.
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 :
Socket(Proxy) constructor accept HTTP type proxy objects so that a socket connection can be successfully negociated through an HTTP proxy
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 ----------