ws = new WebSocket("ws://127.0.0.1:7272");
ws.onopen = function() {
ws . send('{"mode":"say","order_id":"21",type:1,"content":"文字内容","user_id":21}');
};
ws.onmessage = function(e) {
console.log("收到服务端的消息:" + e.data);
};
来源:CSDN
作者:飞鱼计划
链接:https://blog.csdn.net/qq_35669659/article/details/103598066