Skip to content

Instantly share code, notes, and snippets.

@cordoval
Forked from havvg/zombie.js
Created September 13, 2011 14:41
Show Gist options
  • Save cordoval/1213963 to your computer and use it in GitHub Desktop.
Save cordoval/1213963 to your computer and use it in GitHub Desktop.
var net = require('net');
var sys = require('sys');
var zombie = require('zombie');
var browser = null;
var pointers = [];
var buffer = "";
net.createServer(function (stream) {
stream.setEncoding('utf8');
stream.allowHalfOpen = true;
stream.on('data', function (data) {
buffer += data;
});
stream.on('end', function () {
if (browser == null) {
browser = new zombie.Browser({ debug: true });
// Clean up old pointers
pointers = [];
}
eval(buffer);
buffer = "";
});
}).listen(8124, '127.0.0.1');
console.log('Zombie.js server running at 127.0.0.1:8124');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment