How to handle HTTP upgrade in ExpressJS?
express, node.js
Solution
Since my comment seemed to work for you, I'll put it in an answer.
`express.createServer()` has been deprecated for a long time and removed from Express 4. You would create the app object in Express 4 with:
var app = express()
The http server object is then returned from
var server = app.listen(...)
If you need direct access to the http server object.
Problem
The newest ExpressJS doesn't inherit from http.Server anymore. If I try to listen on the `upgrade` event, the server will answer with a `404 Not Found`. Current [simplified] code is: ``` app.on('upgrade', function(req, socket, head) { /* ... */ }); ``` If I try to search for the answer on Google, I'll only find links related to "3.0 -> 4.0 express upgrade", not HTTP upgrade. EDIT: As requested by @jfriend00 , my express initialization [simplified] code: ``` app = express.createServer(); app.listen(self.port, self.ipaddress); ```