title: Socket.io-client: NodeJS no response
body: <p>I am using Socket.io-client to create a crypto ticker. Here is my code. </p>
  
  <pre><code>var express = require("express");
  var app = express();
  var request = require("request")
  var bodyParser = require("body-parser");
  var methodOverride = require("method-override");
  var socket = require('socket.io-client');
  
  //Other Important stuff
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(express.static(__dirname + '/views/src'));
  app.set('view engine', 'ejs');
  app.use(methodOverride("_method"));
  
  var io = socket("https://coincap.io/");
  
  io.on('connect', function(){
  console.log(io.id); //This displays the ID
  });
  
  //Home Page
  app.get("/", function(req, res) {
        console.log("reached here");
  io.on('connect', function(tradeMsg){
    console.log(io.connected); //Displays nothing
        var crypto = tradeMsg;
        console.log(crypto); //Displays nothing 
        res.render("index.ejs", {crypto:crypto});
      })
  });
  </code></pre>
  
  <p>Now, When I load <code>localHost:3000</code> page, it displays ("reached here") but there after it doesn't do anything (besides that load circle on chrome). My console.log also happens to be empty where it should have probably shown something.</p>
  
  <p>here is the sample code for <a href="https://github.com/CoinCapDev/CoinCap.io/blob/master/subscribe.html" rel="nofollow noreferrer">coincap socket</a></p>
  
  <p>What have I been doing wrong lately?</p>