RFR: 8245095: Implementation of JEP 408: Simple Web Server

Julia Boes jboes at openjdk.java.net
Wed Sep 15 08:45:49 UTC 2021


On Tue, 14 Sep 2021 15:56:28 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> This change implements a simple web server that can be run on the command-line with `java -m jdk.httpserver`.
>> 
>> This is facilitated by adding an entry point for the `jdk.httpserver` module, an implementation class whose main method is run when the above command is executed. This is the first such module entry point in the JDK.
>> 
>> The server is a minimal HTTP server that serves the static files of a given directory, similar to existing alternatives on other platforms and convenient for testing, development, and debugging.
>> 
>> Additionally, a small API is introduced for programmatic creation and customization.
>> 
>> Testing: tier1-3.
>
> src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsServer.java line 152:
> 
>> 150:         return server;
>> 151:     }
>> 152: 
> 
> Too bad we couldn't simplify the setting up a basic certificate for https.

That would be nice indeed, but the goal of this JEP is a minimal HTTP-only server, intentionally leaving anything HTTPS aside. `HttpsServer::create` being the exception, added to provide the same convenience as for `HttpServer`. Any HTTPS configuration can be done using the existing API.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5505


More information about the core-libs-dev mailing list