Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6370908

Add support for HTTP_CONNECT proxy in Socket class

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • P4
    • Resolution: Fixed
    • 6
    • 8
    • core-libs
    • b82
    • sparc
    • solaris_10
    • Verified

    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 ----------

      Attachments

        Activity

          People

            chegar Chris Hegarty
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: