From d68dd30d89d9980e90469ea55a048e71971b0da7 Mon Sep 17 00:00:00 2001 From: joshua bauer Date: Mon, 15 May 2017 13:40:10 -0700 Subject: [PATCH] Added http2 support. --- README.md | 2 +- src/main/java/io/sinistral/proteus/ProteusApplication.java | 2 +- .../META-INF/services/io.undertow.protocols.alpn.ALPNProvider | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNProvider diff --git a/README.md b/README.md index ff73e05..041a6d3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![Alt logo](https://cdn.rawgit.com/noboomu/proteus/master/src/main/resources/proteus-logo.svg) +![Alt logo](https://cdn.rawgit.com/noboomu/proteus/master/src/main/resources/io/sinistral/proteus/proteus-logo.svg) An extremely lightweight, flexible, and fast [Swagger](http://swagger.io/) first REST API framework atop [Undertow](http://undertow.io). A great deal of inspiration came from working with the following excellent projects: [Play](http://playframework.com), [Jooby](http://jooby.org), and [light-4j](https://github.com/networknt/light-4j). diff --git a/src/main/java/io/sinistral/proteus/ProteusApplication.java b/src/main/java/io/sinistral/proteus/ProteusApplication.java index be7cd63..ae61e9c 100644 --- a/src/main/java/io/sinistral/proteus/ProteusApplication.java +++ b/src/main/java/io/sinistral/proteus/ProteusApplication.java @@ -238,7 +238,7 @@ public void buildServer() .addHttpListener(config.getInt("application.ports.http"),config.getString("application.host")) .setBufferSize(16 * 1024) .setIoThreads( config.getInt("undertow.ioThreads") ) - .setServerOption(UndertowOptions.ENABLE_HTTP2, false) + .setServerOption(UndertowOptions.ENABLE_HTTP2, config.getBoolean("undertow.enableHttp2")) .setServerOption(UndertowOptions.ALWAYS_SET_DATE, true) .setSocketOption(org.xnio.Options.BACKLOG, config.getInt("undertow.socket.backlog") ) .setServerOption(UndertowOptions.ALWAYS_SET_KEEP_ALIVE, false) diff --git a/src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNProvider b/src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNProvider new file mode 100644 index 0000000..d330eb1 --- /dev/null +++ b/src/main/resources/META-INF/services/io.undertow.protocols.alpn.ALPNProvider @@ -0,0 +1 @@ +io.undertow.protocols.alpn.JettyAlpnProvider \ No newline at end of file