< prev index next >

test/java/net/Socket/HttpProxy.java

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 6370908
  27  * @summary Add support for HTTP_CONNECT proxy in Socket class

  28  */
  29 
  30 import java.io.IOException;
  31 import java.io.InputStream;
  32 import java.io.OutputStream;
  33 import java.io.PrintWriter;
  34 import static java.lang.System.out;
  35 import java.net.InetAddress;
  36 import java.net.InetSocketAddress;
  37 import java.net.Proxy;
  38 import java.net.ServerSocket;
  39 import java.net.Socket;
  40 import sun.net.www.MessageHeader;
  41 
  42 public class HttpProxy {
  43     final String proxyHost;
  44     final int proxyPort;
  45     static final int SO_TIMEOUT = 15000;
  46 
  47     public static void main(String[] args) throws Exception {




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 6370908
  27  * @summary Add support for HTTP_CONNECT proxy in Socket class
  28  * @modules java.base/sun.net.www
  29  */
  30 
  31 import java.io.IOException;
  32 import java.io.InputStream;
  33 import java.io.OutputStream;
  34 import java.io.PrintWriter;
  35 import static java.lang.System.out;
  36 import java.net.InetAddress;
  37 import java.net.InetSocketAddress;
  38 import java.net.Proxy;
  39 import java.net.ServerSocket;
  40 import java.net.Socket;
  41 import sun.net.www.MessageHeader;
  42 
  43 public class HttpProxy {
  44     final String proxyHost;
  45     final int proxyPort;
  46     static final int SO_TIMEOUT = 15000;
  47 
  48     public static void main(String[] args) throws Exception {


< prev index next >