Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Avoid conflicts with other WebSocketServer's by enabling more options. #31

wants to merge 3 commits into


None yet
3 participants

jseb commented May 21, 2013

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

sarenji commented May 22, 2013

That makes sense. @dennismartensson @cavedweller opinions?


dennismartensson commented May 22, 2013

I think it looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment