webRTC/webRTC.io — pull request #31 by jseb (2013-05-21 18:48:39+00:00)
Title: Avoid conflicts with other WebSockerServer's by enabling more options.

webRTC accepted one parameter to it's listen method, which value could be either a port or a httpServer. The parameter were checked for type, and then either the option(s) { server: parameter } or { port: parameter } were sent to ws.WebSocketServer constructor.

To enable more options (in this case the path option was wanted to avoid conflicts with other websocket servers) and also re-use the option parsing in WebSocketServer, the listen method now accepts an options object, which it then directly passes on to the WebSocketServer constructor.

* no option parsing in the form of typechecking or other is needed in webRTC's listen method
* more options are available, for example the path option
* options to webRTC will have the same form as WebSocketServer, which makes code more consistent