70.15 启用Undertow的多监听器

UndertowBuilderCustomizer添加到UndertowEmbeddedServletContainerFactory,然后使用Builder添加一个listener:

  1. @Bean
  2. public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
  3. UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
  4. factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {
  5. @Override
  6. public void customize(Builder builder) {
  7. builder.addHttpListener(8080, "0.0.0.0");
  8. }
  9. });
  10. return factory;
  11. }