How to enable HTTP/2 support in Spring Boot?

devquora
devquora

Posted On: Feb 22, 2018

 

You can enable HTTP/2 support in Spring Boot as follows: server.http2.enabled=true

Example:-

	
@Bean public ConfigurableServletWebServerFactory tomcatCustomizer() {

    TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); 
factory.addConnectorCustomizers(connector -> connector.addUpgradeProtocol(new Http2Protocol())); return factory; }

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Spring Boot Interview questions

    What does Spring Boot mean?

    Spring Boot is a system from “The Spring Team” to facilitate the bootstrapping and development of new Spring Applica..

    Spring Boot Interview questions

    What are the various Advantages Of Using Spring Boot?

    Here are some of the various advantages of using Spring Boot:It is quite easy to create Spring Based applications with..

    Spring Boot Interview questions

    What are the various features of Spring Boot?

    Various Spring Boot Features are as follows:Web Development Spring Application Application occasions and listeners Adm..