HenningM/express-ws — pull request #1 by piranna (2014-08-02 14:22:53+00:00)
Title: Optional server parameter & using native 'http' module

This pull-request use the Node.js native 'http' module instead of the 'node-mocks-http' one, leveraging to less dependencies.

On the other hand, it also allow the 'server' parameter to be optional, but with some tricks: 'express' is protocol agnostic so it doesn't have any reference to its underlying http server, so I'm overriding the 'listen()' method to capture it, so it must be called before the WebSocket endpoint is enabled (I have updated the example showing it). Obviously, if the http server instance is created externally (not with the express 'listen()' method) then it must be passed as argument to express-ws enabler... :-)