title: Azure web Node js
body: <p>I have created a node js website using azure node js template 
  the app uses express and socket io</p>
  
  <p>This is the server code
  I have written a simple server side code with logs for each function</p>
  
  <p>my server side code is: </p>
  
  <pre><code>var express = require('express');
  var app = express();
  ////Creating Server
  var server = require('http').createServer(app);
  //For Socket IO
  var io = require('socket.io').listen(server);
  var port = process.env.port || 1337
  server.listen(port);
  var connections = [];
  console.log('Server Running....');
  
  io.sockets.on('connection', function (socket) {
      connections.push(socket);
      console.log('Connected: %s sockets connected', connections.length);
  
  socket.on('subscribe', function (room) {
      //It's not logging this
      console.log('Connections: ', connections.length, ' Room: ', room);
      socket.join(room);
  });
  
  socket.on('disconnect', function (data) {
      connections.splice(connections.indexOf(socket), 1);
      console.log('Disconnected: %s sockets still connected',       connections.length);  
  });
  
  socket.on('send message', function (data) {
      console.log('Message.', data.message);
        //this works fine when i comment the 'subscribe' function
        io.sockets.emit('new message', { msg: data.message, room: data.room});
  
     //I want this to work
       io.sockets.in(data.room).emit('new message', { msg: data.message, room: data.room });
  });
  });
  
  
  });
  </code></pre>
  
  <p>From the client 
  I connect to the website and use a emit to connect to the particular room</p>
  
  <p>Client Side Code:    </p>
  
  <pre><code>//Inside document.ready i am calling this
  
  var socket = io.connect('http://example.azurewebsites.net'); //url
  socket.emit('subscribe', 1);//Hardcoded
   $('#send').click(function (e) { // Send Button
       socket.emit('send message', {
              room: 1,
              message: $('#message').val() // Input Box Value
          });
   });
   socket.on('new message', function (data) {
      console.log('Message :',data.message,'Room :',data.room);
   });
  </code></pre>
  
  <p>The problem I am facing is the 'subscribe' function not working,
  I get no logs for it.</p>
  
  <p>What could be the reason</p>