Java HTTP/2 Server Socket

前端 未结 2 2039
有刺的猬
有刺的猬 2021-01-05 00:47

I want to get server sockets working for HTTP/2 in Java, preferably TLS/https.

I\'ve got a TLS server socket working fine, but browsers will only talk HTTP/1.1 to it

2条回答
  •  北海茫月
    2021-01-05 01:29

    Java won't get ALPN until at least JDK 9, which is slated for late 2016 or 2017.

    Meanwhile, you can use Jetty's ALPN implementation, or better yet, use Jetty (or other servers as suggested) directly rather than doing your own HTTP/2 implementation using ServerSocket.

    [Disclaimer, I am a Jetty committer] Jetty 9.3 has great support for HTTP/2, including HTTP/2 Push.

提交回复
热议问题