Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

http请求次数问题

$
0
0

var http = require(‘http’); var url = require(‘url’); http.createServer(function(req,res){ console.log(req.method); console.log(req.url); res.writeHead(200,{‘Content-Type’:‘text/plain’}); res.end(‘hello world’);

}).listen(8009,‘127.0.0.1’); console.log(‘server is on’); 在请求的时候服务端log出请求方法和请求url 启动服务器 访问http://127.0.0.1:8009
1.png

控制台发现了四次请求 get
打开chrome的network截图如下 2.png正常的请求127.0.0.1:8009 和请求 favicon.ico都明白 为什么会多出两次请求呢 chrome请求了一个诡异的js 那另外的一个请求是什么呢 为什么在network的左下角显示3requests呢

求大神解答1.png


Viewing all articles
Browse latest Browse all 14821

Trending Articles