test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java
branchhttp-client-branch
changeset 56076 9a2855e0a796
parent 56045 5c6e3b76d2ad
child 56263 4933a477d628
--- a/test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java	Tue Feb 06 10:34:47 2018 +0000
+++ b/test/jdk/java/net/httpclient/websocket/DummyWebSocketServer.java	Tue Feb 06 11:04:44 2018 +0000
@@ -145,7 +145,7 @@
         ssc = ServerSocketChannel.open();
         try {
             ssc.configureBlocking(true);
-            ssc.bind(new InetSocketAddress("localhost", 0));
+            ssc.bind(new InetSocketAddress(0));
             address = (InetSocketAddress) ssc.getLocalAddress();
             thread.start();
         } catch (IOException e) {
@@ -165,7 +165,7 @@
         if (!started.get()) {
             throw new IllegalStateException("Not yet started");
         }
-        return URI.create("ws://" + address.getHostName() + ":" + address.getPort());
+        return URI.create("ws://localhost:" + address.getPort());
     }
 
     private boolean readRequest(SocketChannel channel, StringBuilder request)