Websocket 接口,用来进行前后端的 websocket 实时通信。消息结构体如下。
请求消息
{
"type":"string" // 消息类别, ping 指心跳消息,chat 指聊天消息
"channel":"string" // 消息频道, chat,mj,sd,suno...
"body": "any" // 消息内容,可以是任意对象
}响应消息
{
"channel": "string" // 消息频道
"clientId" : "string" // 客户端ID
"type": "string" // 消息类别 pong 心跳,text 文本消息,end 消息结尾,error 错误消息
}