equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
58 String ip6_literal = address.getHostAddress(); |
58 String ip6_literal = address.getHostAddress(); |
59 |
59 |
60 out.println("Found an appropriate IPv6 address: " + address); |
60 out.println("Found an appropriate IPv6 address: " + address); |
61 |
61 |
62 out.println("Starting http server..."); |
62 out.println("Starting http server..."); |
63 HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); |
63 HttpServer server = HttpServer.create(new InetSocketAddress(address, 0), 0); |
64 CompletableFuture<Headers> headers = new CompletableFuture<>(); |
64 CompletableFuture<Headers> headers = new CompletableFuture<>(); |
65 server.createContext("/", createCapturingHandler(headers)); |
65 server.createContext("/", createCapturingHandler(headers)); |
66 server.start(); |
66 server.start(); |
67 out.println("Started at " + server.getAddress()); |
67 out.println("Started at " + server.getAddress()); |
68 |
68 |