test/jdk/java/net/httpclient/http2/ProxyTest2.java
branchhttp-client-branch
changeset 56265 ec34ae013fbe
parent 56233 1753108d07b9
child 56451 9585061fdb04
equal deleted inserted replaced
56264:c012b93297b0 56265:ec34ae013fbe
   175             accept.setDaemon(true);
   175             accept.setDaemon(true);
   176         }
   176         }
   177 
   177 
   178         void start() throws IOException {
   178         void start() throws IOException {
   179             ss.setReuseAddress(false);
   179             ss.setReuseAddress(false);
   180             ss.bind(new InetSocketAddress(0));
   180             ss.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
   181             accept.start();
   181             accept.start();
   182         }
   182         }
   183 
   183 
   184         // Pipe the input stream to the output stream.
   184         // Pipe the input stream to the output stream.
   185         private synchronized Thread pipe(InputStream is, OutputStream os,
   185         private synchronized Thread pipe(InputStream is, OutputStream os,
   209                 }
   209                 }
   210             };
   210             };
   211         }
   211         }
   212 
   212 
   213         public InetSocketAddress getAddress() {
   213         public InetSocketAddress getAddress() {
   214             return new InetSocketAddress(
   214             return new InetSocketAddress( InetAddress.getLoopbackAddress(), ss.getLocalPort());
   215                     "localhost",
       
   216                     ss.getLocalPort());
       
   217         }
   215         }
   218 
   216 
   219         // This is a bit shaky. It doesn't handle continuation
   217         // This is a bit shaky. It doesn't handle continuation
   220         // lines, but our client shouldn't send any.
   218         // lines, but our client shouldn't send any.
   221         // Read a line from the input stream, swallowing the final
   219         // Read a line from the input stream, swallowing the final