test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java
changeset 54086 ccb4a50bee06
parent 53473 9366628d727b
child 54887 442e22c051f0
--- a/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java	Tue Jan 15 15:59:47 2019 -0800
+++ b/test/jdk/sun/net/www/protocol/http/TunnelThroughProxy.java	Wed Feb 27 13:34:40 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -64,8 +64,9 @@
             int serverPort = server.getLocalPort();
 
             Socket sock;
-            sock = new Socket(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("127.0.0.1", proxyPort)));
-            InetSocketAddress dest = new InetSocketAddress("127.0.0.1", serverPort);
+            sock = new Socket(new Proxy(Proxy.Type.HTTP,
+                    new InetSocketAddress(InetAddress.getLoopbackAddress(), proxyPort)));
+            InetSocketAddress dest = new InetSocketAddress(InetAddress.getLoopbackAddress(), serverPort);
             sock.connect(dest);
             int localPort = sock.getLocalPort();
             if (localPort == proxyPort)