Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d144832

Browse files
authored
Merge pull request #14 from SentryMan/patch-1
[Docs] Move up maven coords and http2 config
2 parents 9be9abe + 52332eb commit d144832

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# httpserver
23

34
Zero-dependency implementation of the JDK [`com.sun.net.httpserver.HttpServer` specification](https://docs.oracle.com/en/java/javase/21/docs/api/jdk.httpserver/com/sun/net/httpserver/package-summary.html) with a few significant enhancements.
@@ -31,6 +32,17 @@ Additional proxy and websockets tests are included.
3132

3233
The http2 implementation passes all specification tests in [h2spec](https://github.com/summerwind/h2spec)
3334

35+
## maven
36+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.robaho/httpserver.svg?label=Maven%20Central)](https://mvnrepository.com/artifact/io.github.robaho/httpserver)
37+
38+
```xml
39+
<dependency>
40+
<groupId>io.github.robaho</groupId>
41+
<artifactId>httpserver</artifactId>
42+
<version>1.0.19</version>
43+
</dependency>
44+
```
45+
3446
## using
3547

3648
The JDK will automatically use `robaho.net.httpserver.DefaultHttpServerProvider` instead of the JDK implementation when the jar is placed on the class/module path. If there are multiple `HttpServer` providers on the classpath, the `com.sun.net.httpserver.HttpServerProvider` system property can be used to specify the correct one:
@@ -86,6 +98,16 @@ gradle runSimpleFileServer
8698

8799
All logging is performed using the [Java System Logger](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/System.Logger.html)
88100

101+
## enable Http2
102+
103+
Http2 support is enabled via Java system properties.
104+
105+
Use `-Drobaho.net.httpserver.http2OverSSL=true` to enable Http2 only via SSL connections.
106+
107+
Use `-Drobaho.net.httpserver.http2OverNonSSL=true` to enable Http2 on Non-SSL connections (which requires prior knowledge). The Http2 upgrade mechanism was deprecated in RFC 9113 so it is not supported.
108+
109+
See the additional Http2 options in `ServerConfig.java`
110+
89111
## performance
90112

91113
This version performs more than **10x** faster than the JDK version when tested using the [Tech Empower Benchmarks](https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Java/httpserver) on an identical hardware/work setup with the same JDK 23 version.<sup>1</sup>
@@ -288,25 +310,6 @@ Reply Errors: 0
288310

289311
The counts and rates for non "Total" statistics are reset with each pull of the statistics.
290312

291-
## maven
292-
293-
```xml
294-
<dependency>
295-
<groupId>io.github.robaho</groupId>
296-
<artifactId>httpserver</artifactId>
297-
<version>1.0.19</version>
298-
</dependency>
299-
```
300-
## enable Http2
301-
302-
Http2 support is enabled via Java system properties.
303-
304-
Use `-Drobaho.net.httpserver.http2OverSSL=true` to enable Http2 only via SSL connections.
305-
306-
Use `-Drobaho.net.httpserver.http2OverNonSSL=true` to enable Http2 on Non-SSL connections (which requires prior knowledge). The Http2 upgrade mechanism was deprecated in RFC 9113 so it is not supported.
307-
308-
See the additional Http2 options in `ServerConfig.java`
309-
310313
## performance notes
311314

312315
Http2 performance has not been fully optimized. The http2 version is about 20-30% slower than http1. I expect this to be the case with most http2 implementations due to the complexity.

0 commit comments

Comments
 (0)