spring boot http2

项目已启动的情况下,启动单元测试报端口has binded

可以使用server.port=-1 禁用端口绑定来启动单元测试

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html#howto-change-the-http-port

http2配置

使用tomcat9 & jdk9+

或者使用tomcat9 & jdk8 with nativelibrary

使用undertow & jdk8+

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html#howto-configure-http2-tomcat

生成证书,配置ssl

配置模块依赖packageinfo.java?  模块化是jdk的模块化,对于具体maven web应用这个概念不是必须的

使用浏览器验证:访问相关接口,在chrome://net-internals/中查看事件

使用curl验证:

 

示例:

https://files.cnblogs.com/files/yszzu/spring-http2-demo.zip

原文地址:https://www.cnblogs.com/yszzu/p/9936039.html