// Generated by CoffeeScript 1.6.3
(function() {
  var clicks, io, tones;

  io = require('socket.io').listen(process.env.PORT || 8888);

  clicks = [];

  tones = io.of('/tones').on('connection', function(socket) {
    socket.on('greeting', function(data) {
      console.log(data);
      return socket.emit('greeting', {
        greeting: 'Hello client!'
      });
    });
    socket.emit('grid status', {
      clicks: clicks
    });
    return socket.on('grid click', function(data) {
      console.log(data);
      clicks.push(data);
      return socket.broadcast.emit('grid click', {
        element: data.element,
        sender: data.sender
      });
    });
  });

}).call(this);

// Generated by CoffeeScript 1.6.3
(function() {
  var clicks, io, tones;

  var app = require('http').createServer(function() {});
  io = require('socket.io').listen(app);

  clicks = [];

  tones = io.of('/tones').on('connection', function(socket) {
    socket.on('greeting', function(data) {
      console.log(data);
      return socket.emit('greeting', {
        greeting: 'Hello client!'
      });
    });
    socket.emit('grid status', {
      clicks: clicks
    });
    return socket.on('grid click', function(data) {
      console.log(data);
      clicks.push(data);
      return socket.broadcast.emit('grid click', {
        element: data.element,
        sender: data.sender
      });
    });
  });

  app.listen(process.env.PORT || 8888);

}).call(this);

Fix problem with startup on heroku
Fix problem with startup on heroku

Had to surround socket.io with an http server to run on heroku.
