|
|
@@ -0,0 +1,29 @@
|
|
|
+package net.mingsoft.config;
|
|
|
+
|
|
|
+import org.apache.catalina.connector.Connector;
|
|
|
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
|
|
+import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 增加一个HTTP的接口监听
|
|
|
+ *
|
|
|
+ * @author hx
|
|
|
+ * @date 2026-02-04
|
|
|
+ */
|
|
|
+@Configuration
|
|
|
+public class TomcatConfig {
|
|
|
+ @Bean
|
|
|
+ public ServletWebServerFactory serverFactory() {
|
|
|
+ TomcatServletWebServerFactory tomcet = new TomcatServletWebServerFactory();
|
|
|
+ tomcet.addAdditionalTomcatConnectors(createConnector());
|
|
|
+ return tomcet;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Connector createConnector() {
|
|
|
+ Connector c = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
|
|
+ c.setPort(80);
|
|
|
+ return c;
|
|
|
+ }
|
|
|
+}
|