title: How to handle HTTP upgrade in ExpressJS?
body: <p>The newest ExpressJS doesn't inherit from http.Server anymore.</p>
  
  <p>If I try to listen on the <code>upgrade</code> event, the server will answer with a <code>404 Not Found</code>.</p>
  
  <p>Current [simplified] code is:</p>
  
  <pre><code>app.on('upgrade', function(req, socket, head) { /* ... */ });
  </code></pre>
  
  <p>If I try to search for the answer on Google, I'll only find links related to "3.0 -> 4.0 express <em>upgrade</em>", not <strong>HTTP</strong> <em>upgrade</em>.</p>
  
  <h2>EDIT:</h2>
  
  <p>As requested by @jfriend00 , my express initialization [simplified] code:</p>
  
  <pre><code>app = express.createServer();
  app.listen(self.port, self.ipaddress);
  </code></pre>