var http = require('http');
http.createServer(function (req, res) {
console.log(req.headers['user-agent'])
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
这么一段简单的代码,为什么每次访问都是输出两次
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
很郁闷,难道一次请求,触发两次request事件?