websocket发送对象

let obj = {
    rgb_img:123
    ir_img:123
  }
  var decc = new TextEncoder();
  let str = decc.encode((JSON.stringify(obj)))
  ws&&ws.send(str);

你可能感兴趣的:(websocket发送对象)