wx.connectSocket({ url: 'wss://example.qq.com', data:{ x: '', y: '' }, header:{ 'content-type': 'application/json' }, protocols: ['protocol1'], method:"GET" })参数data在nodedjs端如何接收?服务端用的是ws,在request里没有找到data
1 回答
开满天机
TA贡献1786条经验 获得超13个赞
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8080 });
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(message) {
console.log('received: %s', message);
});
ws.send('something');
});
message接收
添加回答
举报
0/150
提交
取消