An abstraction layer for webRTC. Aim is to simplify the HTML5 web standard webRTC in a similar manner to socket.io w/ websockets. Highly experimental technology
1.6k
stars
293
forks
source link
Avoid conflicts with other WebSocketServer's by enabling more options. #31
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
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.