用以下代码udp到google的dns,协议包内容用wireshark分析完全正确。但google就是不给我任何返回信息
var dgram = require(‘dgram’); var message = new Buffer("518601000001000000000000027a680977696b697065646961036f72670000010001",’hex’);
var server = dgram.createSocket(“udp4”);
server.on("message", function (msg, rinfo) { console.log("server got: " + msg.toString(‘hex’) + " from " + rinfo.address + “:” + rinfo.port); });
server.on("listening", function () { var address = server.address(); console.log("server listening " + address.address + “:” + address.port); //console.log(message); server.send(message,0,message.length,53,’8.8.8.8’); });
server.bind(41234);