socket.on('data', function(data, socket){
console.log(socket);
worker.handle(data, socket);
When I do this, the output is undefined. Why do I get that instead of socket data?
This passes an (undefined) socket to my worker script, which then tries to write to that undefined socket, crashing the server.