Permalink
Browse files

merge sequoiar #30

  • Loading branch information...
2 parents d50c706 + 27edb83 commit eee63d993bf80a3cef44304cf21cda550b1b9de8 @ericz ericz committed Jan 16, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/server.js
View
@@ -17,7 +17,13 @@ function BinaryServer(options) {
this.clients = {};
this._clientCounter = 0;
- this._server = new ws.Server(options);
+
+ if (options.server && (options.server instanceof ws.Server)) {
+ this._server = options.server;
+ } else {
+ this._server = new ws.Server(options);
+ }
+
this._server.on('connection', function(socket){
var clientId = self._clientCounter;
var binaryClient = new BinaryClient(socket, options);

0 comments on commit eee63d9

Please sign in to comment.