如何作为缓冲区二进制响应?
sock.on('data', function(data) { console.log('DATA ' + sock.remoteAddress + ': ' + data); let response = new Buffer("0000", "base64"); setTimeout(function() { sockets.forEach(function(sock, index, array) { sock.write(response); }); }, 3000); });
Buffer.from("00aabbcc","hex")
或
Buffer.from([0x0,0xaa,0xbb,0xcc])
https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/