Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ChenBbMing
springboot-template_318963
提交
0072a47b
S
springboot-template_318963
项目概览
ChenBbMing
/
springboot-template_318963
与 Fork 源项目一致
Fork自
小小白鸽 / springboot-template
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
springboot-template_318963
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0072a47b
编写于
4月 26, 2023
作者:
6
632d6423b4d9145d677b07db
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto commit
上级
3f614a6a
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
39 addition
and
2 deletion
+39
-2
src/main/java/com/lhstack/TemplateApplication.java
src/main/java/com/lhstack/TemplateApplication.java
+33
-0
src/main/resources/application.yml
src/main/resources/application.yml
+3
-1
target/classes/application.yml
target/classes/application.yml
+3
-1
target/classes/com/lhstack/TemplateApplication$1$1.class
target/classes/com/lhstack/TemplateApplication$1$1.class
+0
-0
target/classes/com/lhstack/TemplateApplication$1.class
target/classes/com/lhstack/TemplateApplication$1.class
+0
-0
target/classes/com/lhstack/TemplateApplication.class
target/classes/com/lhstack/TemplateApplication.class
+0
-0
未找到文件。
src/main/java/com/lhstack/TemplateApplication.java
浏览文件 @
0072a47b
package
com.lhstack
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.coyote.http11.Http11Nio2Protocol
;
import
org.apache.coyote.http11.Http11Processor
;
import
org.apache.tomcat.util.buf.MessageBytes
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
import
org.springframework.context.annotation.Bean
;
import
org.apache.coyote.Processor
;
@SpringBootApplication
public
class
TemplateApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
TemplateApplication
.
class
,
args
);
}
@Bean
public
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
webServerFactoryCustomizer
(){
return
serverFactory
->
{
Connector
connector
=
new
Connector
(
new
Http11Nio2Protocol
()
{
@Override
protected
Processor
createProcessor
()
{
return
new
Http11Processor
(
this
,
this
.
getAdapter
())
{
@Override
protected
void
parseHost
(
MessageBytes
valueMB
)
{
MessageBytes
messageBytes
=
MessageBytes
.
newInstance
();
String
hostname
=
valueMB
.
toString
();
messageBytes
.
setString
(
hostname
.
replace
(
"_"
,
"-"
));
messageBytes
.
toBytes
();
super
.
parseHost
(
messageBytes
);
}
};
}
});
connector
.
setPort
(
8080
);
serverFactory
.
addAdditionalTomcatConnectors
(
connector
);
};
}
}
src/main/resources/application.yml
浏览文件 @
0072a47b
aes
:
key
:
axiwlazlf1456175
iv
:
114aqws431@#!%_+
server
:
port
:
8081
\ No newline at end of file
target/classes/application.yml
浏览文件 @
0072a47b
aes
:
key
:
axiwlazlf1456175
iv
:
114aqws431@#!%_+
server
:
port
:
8081
\ No newline at end of file
target/classes/com/lhstack/TemplateApplication$1$1.class
0 → 100644
浏览文件 @
0072a47b
文件已添加
target/classes/com/lhstack/TemplateApplication$1.class
0 → 100644
浏览文件 @
0072a47b
文件已添加
target/classes/com/lhstack/TemplateApplication.class
浏览文件 @
0072a47b
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录