From 8c600daf86fd41d168d6785de81f6f4aeef79fdd Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 4 Mar 2025 00:50:31 +0800 Subject: [PATCH] :bug: Fix decoding websocket package issue --- pkg/internal/grpc/stream.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/internal/grpc/stream.go b/pkg/internal/grpc/stream.go index 6b15088..8b82427 100644 --- a/pkg/internal/grpc/stream.go +++ b/pkg/internal/grpc/stream.go @@ -69,12 +69,13 @@ func (v *App) PushStream(_ context.Context, request *proto.PushStreamRequest) (* break } - raw, _ := jsoniter.Marshal(data) - // Forward ask request sc.PushStream(context.Background(), &proto.PushStreamRequest{ UserId: lo.ToPtr(uint64(data.UserID)), - Body: raw, + Body: nex.WebSocketPackage{ + Action: "kex.ask", + Payload: data, + }.Marshal(), }) case "kex.ack": var data struct { @@ -113,12 +114,13 @@ func (v *App) PushStream(_ context.Context, request *proto.PushStreamRequest) (* break } - raw, _ := jsoniter.Marshal(data) - // Forward ack request sc.PushStream(context.Background(), &proto.PushStreamRequest{ ClientId: request.ClientId, - Body: raw, + Body: nex.WebSocketPackage{ + Action: "kex.ack", + Payload: data, + }.Marshal(), }) }