客户端连接时认证失败,直接断开连接

This commit is contained in:
aoshiguchen
2023-06-02 22:24:20 +08:00
parent 2ec87abda9
commit bcd429d54f
3 changed files with 10 additions and 3 deletions
@@ -2,6 +2,7 @@ package org.dromara.neutrinoproxy.client.handler;
import com.alibaba.fastjson.JSONObject;
import org.dromara.neutrinoproxy.core.Constants;
import org.dromara.neutrinoproxy.core.ExceptionEnum;
import org.dromara.neutrinoproxy.core.ProxyMessage;
import org.dromara.neutrinoproxy.core.ProxyMessageHandler;
import org.dromara.neutrinoproxy.core.dispatcher.Match;
@@ -24,5 +25,8 @@ public class ProxyMessageAuthHandler implements ProxyMessageHandler {
JSONObject data = JSONObject.parseObject(info);
Integer code = data.getInteger("code");
log.info("认证结果:{}", info);
if (!ExceptionEnum.SUCCESS.getCode().equals(code)) {
context.channel().close();
}
}
}