将UndertowBuilderCustomizer添加到UndertowServletWebServerFactory,然后使用Builder添加一个listener:
UndertowBuilderCustomizer
UndertowServletWebServerFactory
Builder
@Bean public UndertowServletWebServerFactory servletWebServerFactory() { UndertowServletWebServerFactory factory = new UndertowServletWebServerFactory(); factory.addBuilderCustomizers(new UndertowBuilderCustomizer() { @Override public void customize(Builder builder) { builder.addHttpListener(8080, "0.0.0.0"); } }); return factory; }
最后更新于4年前