Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. var http = require('http');
  2. var spawn = require('child_process').spawn;
  3.  
  4. http.createServer(function(req,res) {
  5. spawnchild = spawn('asdf', ['-f', '/var/log/syslog']);
  6. spawnchild.stdout.on('data', function(data) {
  7. console.log(data);
  8. });
  9. spawnchild.stderr.on('data', function(data) {
  10. console.log('stderr:' + data);
  11. res.write(data);
  12. });
  13. }).listen(4000);
  14.  
  15. console.log("Listening to syslog");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement