Skip to content

plelevier/jetty-http2-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jetty-http2-server

Embedded Jetty server with HTTP and HTTP/2, with the following resources :

  • A catch all resource * that handle (almost) all the GET and POST requests;
  • A Server Sent Event (SSE) resource /sse/watch that allows streaming of the catch all logs as SSE events

How to Run

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

Test using Web Browser

Point your browser to https://localhost:8443

Watch logs using a SSE client

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"

Watch logs using the UI

Point your browser to https://localhost:8080/watch. When you'll make request on the server, you should see the events occur

Test using h2c

Download and install the latest h2c release from github.com/fstab/h2c.

h2c get https://localhost:8443

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published