TCP 发送脚本 (Node.js)
如需直接 TCP 发送,复制脚本本地运行:
const net = require('net');
const client = net.createConnection({ host: 'IP', port: PORT }, () => {
const packet = Buffer.from('7E020000...', 'hex');
client.write(packet);
});
client.on('data', data => console.log('Recv:', data.toString('hex')));
client.on('error', err => console.error('Error:', err.message));