代码如下:
var request = require('request');
var cheerio = require('cheerio');
var http = require('http');
http.createServer(function (req, res) {
request("http://www.google.com",function(error,response,body){
if(!error && response.statusCode == 200){
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(body);
}
})
}).listen(8080, "127.0.0.1");