Embedded Jetty server with HTTP and HTTP/2, with the following resources :
- A catch all resource
*
that handle (almost) all theGET
andPOST requests
; - A Server Sent Event (SSE) resource
/sse/watch
that allows streaming of the catch all logs as SSE events
mvn package
In order to run the examples, you need Jetty's ALPN boot JAR.
Start the server:
java -Xbootclasspath/p:<path-to-alpn-boot-VERSION.jar> -jar target/jetty-http2-server.jar
Point your browser to https://localhost:8443
Run the command below. When you'll make request on the server, you should see the events occur
curl -v -X GET http://localhost:8080/sse/watch -H "Content-Type: text/event-stream"
Point your browser to https://localhost:8080/watch. When you'll make request on the server, you should see the events occur
Download and install the latest h2c
release from github.com/fstab/h2c.
h2c get https://localhost:8443