var http = require('http');
http.createServer(function(req,res){
res.writeHead(301,{
'Location':'http://baidu.com'
});
res.end();
}).listen(3000,'127.0.0.1');
访问的URL 是127.0.0.1:3000//www.baidu.com 这是为什么?
回复 (2)
L
电脑坏了
B
var http = require('http');
http.createServer(function(req,res){
res.writeHead(302,{
'Location':'http://jsfuns.com'
});
res.end();
}).listen(3000,'127.0.0.1');
参与回复
登录后即可参与回复。登录