增加服务端向客户端下发-文件下载

增加服务端向客户端下发-执行命令
This commit is contained in:
qiminbao
2025-08-29 11:09:56 +08:00
parent 6637647a49
commit ba68735638
3 changed files with 91 additions and 55 deletions
@@ -37,7 +37,8 @@ public class AgentEncoderHandler extends ChannelOutboundHandlerAdapter {
return;
}
AssertLog.info(">>[down]:IP:{},[content]==>{}", sessionManager.client(ctx), entity.getData());
String json = JSON.toJSONString(entity);
// String json = JSON.toJSONString(entity);
String json = "agent-server:"+JSON.toJSONString(entity)+"@tong-ran";
byte[] bytes = json.getBytes(StandardCharsets.UTF_8); // 显式指定 UTF-8
// byte[] bytes = EscapeUtil.hexStringToByteArray(entity.getContent());
ByteBuf buf = Unpooled.wrappedBuffer(bytes);