http代理优化.
This commit is contained in:
+1
@@ -45,6 +45,7 @@ public class ProxyConfig {
|
||||
private Integer bossThreadCount;
|
||||
private Integer workThreadCount;
|
||||
private String domainName;
|
||||
private Integer httpProxyPort;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
||||
private ProxyConfig proxyConfig;
|
||||
@Override
|
||||
public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
|
||||
if (StrUtil.isBlank(proxyConfig.getServer().getDomainName())) {
|
||||
if (StrUtil.isBlank(proxyConfig.getServer().getDomainName()) || null == proxyConfig.getServer().getHttpProxyPort()) {
|
||||
log.info("no config domain name,nonsupport http proxy.");
|
||||
return;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class HttpProxy implements EventListener<AppLoadEndEvent> {
|
||||
ch.pipeline().addLast(new VisitorChannelHandler());
|
||||
}
|
||||
});
|
||||
bootstrap.bind("0.0.0.0", 80).sync();
|
||||
bootstrap.bind("0.0.0.0", proxyConfig.getServer().getHttpProxyPort()).sync();
|
||||
log.info("Http代理服务启动成功!");
|
||||
} catch (Exception e) {
|
||||
log.error("http proxy start err!", e);
|
||||
|
||||
@@ -20,7 +20,8 @@ neutrino:
|
||||
key-store-password: ${STORE_PASS:123456}
|
||||
key-manager-password: ${MGR_PASS:123456}
|
||||
jks-path: ${JKS_PATH:classpath:/test.jks}
|
||||
# 如果不配置,则不支持代理http
|
||||
http-proxy-port: ${HTTP_PROXY_PORT:80}
|
||||
# 如果不配置,则不支持域名映射
|
||||
domain-name: ${DOMAIN_NAME:}
|
||||
data:
|
||||
db:
|
||||
|
||||
Reference in New Issue
Block a user