Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 9th, 2012  |  syntax: None  |  size: 0.30 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. (function() {
  2.   var io;
  3.   io = require('socket.io').listen(4000);
  4.   io.sockets.on('connection', function(socket) {
  5.     socket.on('drawClick', function(data) {
  6.       socket.broadcast.emit('draw', {
  7.         x: data.x,
  8.         y: data.y,
  9.         type: data.type
  10.       });
  11.     });
  12.   });
  13. }).call(this);