thanks for the answer again, I'm using now this okhttp and looks very good for me, the problem is that I need to know how to set the proper ALPN boot jar in the bootclasspath (Jetty), I'm having troubles:

java -Xbootclasspath/p:<path_to_alpn_boot_jar> ...

How I'm gonna put a path to alpn boot jar if I don't have any?

Here is the link:


If you could help me I would appreciate.

2015-11-10 7:34 GMT-03:00 Tomaž Cerar <tomaz.cerar@gmail.com>:
First you will need client api that knows how to handle HTTP2.

java's URL/URI currently don't support http2 at all.
There is JEP http://openjdk.java.net/jeps/110 to add support for it in JDK 9.

AFAK at the moment only https://github.com/square/okhttp client properly supports http2.
But there is lots of development going on around this topic, best to look the internet
for solution that suits you best.


On Mon, Nov 9, 2015 at 9:12 PM, jorge lima <jorge.ayala2012@gmail.com> wrote:

thanks for the answer. But what I really need to know is to discover if some website uses HTTP/2 or not, like how we use in URLConnection with Java:

URL url = new URL("https://developer.jboss.org/");
Map<String, List<String>> map = new HashMap<>();
URL obj = new URL(url.toString());
URLConnection conn = obj.openConnection();
map = conn.getHeaderFields();

Thanks again!

2015-11-09 16:51 GMT-03:00 Tomaž Cerar <tomaz.cerar@gmail.com>:
It is not just http/2 header :)

but yes, undertow supports it, to enable it you will need to upgrade to Java 8 and do some additional setup.

see https://developer.jboss.org/message/929048

for how to setup it.


On Mon, Nov 9, 2015 at 6:15 PM, jorge lima <jorge.ayala2012@gmail.com> wrote:

Is there already a way to get the HTTP/2 response header in Java using Undertow? I really need to know. I'm using JDK 7 on my Java Project. Thank you very much!

undertow-dev mailing list