🐛 Fix decoding websocket package issue

This commit is contained in:
LittleSheep 2025-03-04 00:50:31 +08:00
parent bdef101bc0
commit 8c600daf86

View File

@ -69,12 +69,13 @@ func (v *App) PushStream(_ context.Context, request *proto.PushStreamRequest) (*
break break
} }
raw, _ := jsoniter.Marshal(data)
// Forward ask request // Forward ask request
sc.PushStream(context.Background(), &proto.PushStreamRequest{ sc.PushStream(context.Background(), &proto.PushStreamRequest{
UserId: lo.ToPtr(uint64(data.UserID)), UserId: lo.ToPtr(uint64(data.UserID)),
Body: raw, Body: nex.WebSocketPackage{
Action: "kex.ask",
Payload: data,
}.Marshal(),
}) })
case "kex.ack": case "kex.ack":
var data struct { var data struct {
@ -113,12 +114,13 @@ func (v *App) PushStream(_ context.Context, request *proto.PushStreamRequest) (*
break break
} }
raw, _ := jsoniter.Marshal(data)
// Forward ack request // Forward ack request
sc.PushStream(context.Background(), &proto.PushStreamRequest{ sc.PushStream(context.Background(), &proto.PushStreamRequest{
ClientId: request.ClientId, ClientId: request.ClientId,
Body: raw, Body: nex.WebSocketPackage{
Action: "kex.ack",
Payload: data,
}.Marshal(),
}) })
} }