title: socket.io not work on node.js server (with express)
body: <p>I use express to generate my site(i.e. express mysite); I add socket.io support in my site. But when my socket.io client try to connect server, I found the server has kept receiving 'connection' event(.on('connection', function(socket)...) and client doesn't receive any message...</p>
  
  <p>In my /bin/www</p>
  
  <pre><code>var app = require('../app');
  var debug = require('debug')('mysite:server');
  var http = require('http');
  var https= require('https');
  var fs = require('fs');
  
  
  //Get port from environment and store in Express.
  var port = normalizePort(process.env.PORT || '3000');
  app.set('port', port);
  app.set('httpsport', 443);
  
  //Create HTTP server.
  var options = {
      key: fs.readFileSync('.\file.pem'),
      cert: fs.readFileSync('.\file.crt')
  };
  
  var server = http.createServer(app);
  var httpsServer = https.createServer(options, app).listen(app.get('httpsport'));
  
  //Listen on provided port, on all network interfaces.
  server.listen(port);
  server.on('error', onError);
  server.on('listening', onListening);
  
  //Normalize a port into a number, string, or false.
  function normalizePort(val) {
      var port = parseInt(val, 10);
  
      if (isNaN(port)) {
        // named pipe
        return val;
      }
  
      if (port &gt;= 0) {
        // port number
        return port;
      }
      return false;
  }
  
  //Event listener for HTTP server "error" event.
  function onError(error) {
     ..........
  }
  //Event listener for HTTP server "listening" event.
  function onListening() {
    var addr = server.address();
    var bind = typeof addr === 'string'
      ? 'pipe ' + addr
      : 'port ' + addr.port;
    debug('Listening on ' + bind);
  }
  
  //socket.io
  var io = require('socket.io')(httpsServer);
  
  io.on('connection', function(socket) {    
      //keep printing 'new connection' string in console
      console.log('new connection');
      //client doesn't receive this message
      socket.emit('message', {'message': 'hello world'});
  });
  </code></pre>
  
  <p>my client:</p>
  
  <pre><code>   &lt;html&gt;
       &lt;head&gt;
         &lt;script src="https://cdn.socket.io/socket.io-1.0.0.js"&gt;&lt;/script&gt;
         &lt;script src="https://code.jquery.com/jquery-3.2.1.min.js"
             integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
             crossorigin="anonymous"&gt;&lt;/script&gt;
       &lt;/head&gt;
       &lt;body&gt;
          &lt;script&gt;
            var URL_SERVER = 'https://localhost:443';
            var socket = io.connect(URL_SERVER);
  
            socket.on('message', function(data) {
               $('#message').text(data.message);
            });
         &lt;/script&gt;
         &lt;div id="message"&gt;Message&lt;/div&gt;
        &lt;/body&gt;
      &lt;/html&gt;    
  </code></pre>
  
  <p>any suggestion?</p>