import io.undertow.Undertow; import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; import org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer; import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * Configuration class to enable HTTP listener (when HTTPS is enabled in Spring Boot we need to add support to HTTP manually). */ @Configuration public class HttpConnectorConfiguration { @Bean public EmbeddedServletContainerCustomizer customizeContainer() { return new EmbeddedServletContainerCustomizer() { @Override public void customize(ConfigurableEmbeddedServletContainer container) { if (container instanceof UndertowEmbeddedServletContainerFactory) { UndertowEmbeddedServletContainerFactory factory = (UndertowEmbeddedServletContainerFactory)container; factory.addBuilderCustomizers(new UndertowBuilderCustomizer() { @Override public void customize(Undertow.Builder builder) { builder.addHttpListener(8080, "0.0.0.0"); } }); } } }; } }