添加是否启动配置
This commit is contained in:
+1
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
@ConfigurationProperties(prefix = "neutrino.proxy")
|
||||
@Component
|
||||
public class SpringProxyConfig {
|
||||
private Boolean enable=false;
|
||||
private Protocol protocol;
|
||||
private Tunnel tunnel;
|
||||
private Client client;
|
||||
|
||||
+6
-4
@@ -25,9 +25,11 @@ public class ProxyClientService implements ApplicationRunner {
|
||||
private SpringProxyConfig springProxyConfig;
|
||||
@Override
|
||||
public void run(ApplicationArguments args) {
|
||||
log.info("启动中....");
|
||||
ProxyConfig proxyConfig = BeanUtil.toBean(springProxyConfig, ProxyConfig.class);
|
||||
proxyConfiguration.start(proxyConfig);
|
||||
log.info("启动成功....");
|
||||
if(springProxyConfig.getEnable()){
|
||||
log.info("启动中....");
|
||||
ProxyConfig proxyConfig = BeanUtil.toBean(springProxyConfig, ProxyConfig.class);
|
||||
proxyConfiguration.start(proxyConfig);
|
||||
log.info("启动成功....");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,3 +50,4 @@ neutrino:
|
||||
puppet-port-range: 10000-10500
|
||||
# 是否开启隧道传输报文日志(日志级别为debug时开启才有效)
|
||||
transfer-log-enable: ${CLIENT_LOG:false}
|
||||
enable: true
|
||||
|
||||
Reference in New Issue
Block a user