I am trying to write a script that will visit a script on localhost
and parse it in a node.js script. Here's what I got so far:
var http = require('http');
var options = {
host:'127.0.0.1',
port:'80',
path:'/index.php'
}
var a = http.get(options, function(res){
res.on('data', function(chunk){
console.log(chunk);
});
//console.log(res);
});
But this is all it returns:
<Buffer 7b 22 61 77 65 73 6f 6d 65 22 3a 22 79 65 61 68 21 22 7d>
I know it is some sort of stream but I don't know what to do with it.