1、服务端、客户端认证逻辑调整.

2、解决端口映射被禁用时,客户端启动依然能访问的问题
This commit is contained in:
aoshiguchen
2023-06-02 23:26:13 +08:00
parent 375687aa5f
commit fc4097529f
@@ -26,13 +26,13 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
JSONObject data = JSONObject.parseObject(info);
Integer code = data.getInteger("code");
log.info("认证结果:{}", info);
if (ExceptionEnum.CONNECT_FAILED.getCode().equals(code)) {
context.channel().close();
} else if (ExceptionEnum.AUTH_FAILED.getCode().equals(code)) {
if (ExceptionEnum.AUTH_FAILED.getCode().equals(code)) {
// 客户端认证失败,直接停止服务
log.info("client auth failed , client stop.");
context.channel().close();
Solon.stop();
} else {
context.channel().close();
}
}
}