646 B
646 B
64.13. 启用Undertow的多监听器(Multiple Listeners)
往UndertowEmbeddedServletContainerFactory
添加一个UndertowBuilderCustomizer
,然后添加一个监听者到Builder
:
@Bean
public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {
@Override
public void customize(Builder builder) {
builder.addHttpListener(8080, "0.0.0.0");
}
});
return factory;
}