Commits

ronald martinez committed 80632ea

sds

Comments (0)

Files changed (1)

-require('express')
+//express = require('express')
 
-app = express.createServer();
+//app = express.createServer();
 
 var port = process.env.PORT || 5000;
-var io = require('socket.io')
+var io = require('socket.io').listen(port)
 
 io.configure(function () { 
   io.set("transports", ["xhr-polling"]); 
   io.set("polling duration", 10); 
 });
 
-io.sockets.on("connection", function(message){
-    message.on("newMessage", function(data){
-        message.emit("sendEvent", data);
+io.sockets.on("connection", function(socket){
+    socket.on("newMessage", function(data){
+        socket.emit("sendEvent", data);
     });
 });
 
-app.listen(port)
+//app.listen(port)