You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,21 @@ The built-in JDK httpserver implementation has no support for connection upgrade
21
21
22
22
Additionally, the code still has a lot of async - e.g. using SSLEngine to provide SSL support - which makes it more difficult to understand and enhance.
23
23
24
-
The stream-based processing and thread-per-connection design simplifies the code substantially.
24
+
The thread-per-connection synchronous design simplifies the code substantially.
25
25
26
-
## testing
26
+
## testing/compliance
27
27
28
-
Nearly all tests were included from the JDK, so this version should be highly compliant and reliable.
28
+
Nearly all tests from the JDK are included, so this version should be highly compliant and reliable.
29
+
30
+
Additional proxy and websockets tests are included.
31
+
32
+
The http2 implementation passes all specification tests in [h2spec](https://github.com/summerwind/h2spec)
29
33
30
34
## using
31
35
32
-
The JDK will automatically use `robaho.net.httpserver.DefaultHttpServerProvider` in the place of the default implementation when the jar is placed on the class/module path. If there are multiple `HttpServer` providers on the classpath, we can use the following property when starting the JVM to specify the correct one <code>-Dcom.sun.net.httpserver.HttpServerProvider=robaho.net.httpserver.DefaultHttpServerProvider</code>
36
+
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:
Alternatively, you can instantiate the server directly using [this](https://github.com/robaho/httpserver/blob/main/src/main/java/robaho/net/httpserver/DefaultHttpServerProvider.java#L33).
35
41
@@ -76,7 +82,7 @@ This verson performs more than **10x** better than the JDK version when tested u
76
82
77
83
The frameworks were also tested using [go-wrk](https://github.com/tsliwowicz/go-wrk)<sup>2</sup>
78
84
79
-
<sup>1</sup>_The robaho version has been submitted to the Tech Empower benchmarks project for 3-party confirmation._<br>
85
+
<sup>1</sup>_The [robaho version](https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Java/httpserver-robaho) has been submitted to the Tech Empower benchmarks project for 3-party confirmation._<br>
80
86
<sup>2</sup>_`go-wrk` does not use http pipelining so, the large number of connections is the limiting factor._
81
87
82
88
Performance tests against the latest Jetty version were run. The `robaho httpserver` outperformed the Jetty http2 by 3x, and http1 by 5x.
@@ -278,7 +284,7 @@ The counts and rates for non "Total" statistics are reset with each pull of the
278
284
<dependency>
279
285
<groupId>io.github.robaho</groupId>
280
286
<artifactId>httpserver</artifactId>
281
-
<version>1.0.18</version>
287
+
<version>1.0.19</version>
282
288
</dependency>
283
289
```
284
290
## enable Http2
@@ -291,17 +297,15 @@ Use `-Drobaho.net.httpserver.http2OverNonSSL=true` to enable Http2 on Non-SSL co
291
297
292
298
See the additional Http2 options in `ServerConfig.java`
293
299
294
-
The http2 implementation passes all specification tests in [h2spec](https://github.com/summerwind/h2spec)
295
-
296
300
## performance notes
297
301
298
302
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.
299
303
http2 outperforms http1 when sending multiple simultaneous requests from the client with payloads, as most servers and clients do not implement http pipelining when payloads are involved.
300
304
301
305
TODO: sending hpack headers does not use huffman encoding or dynamic table management. see the following paper https://www.mew.org/~kazu/doc/paper/hpack-2017.pdf for optimizing the implementation further.
302
306
303
-
The most expensive operations involve converting strings to URI instances. Unfortunately, since using URI is part of the server specification little can be done in this regard.
304
-
It could be instantiated lazily, but almost all handlers need access to elements.
307
+
The most expensive operations involve converting strings to URI instances. Unfortunately, since using URI is part of the [HttpExchange API](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpExchange.html#getRequestURI()) little can be done in this regard.
308
+
It could be instantiated lazily, but almost all handlers need access to the URI components (e.g. path, query, etc.)
305
309
306
310
The standard JDK Headers implementation normalizes all headers by ensuring the first character is a capital letter, and the rest lowercase. A better solution would be to use all lowercase to match http2, so less conversions would be required. The scheme is also more complex than needs to be. So, Handler code should be written using the same scheme:
0 commit comments