Skip to content

Commit

Permalink
Allow the use of a custom parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Arrachequesne committed Feb 17, 2017
1 parent 1ac8374 commit 40de1ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function Manager (uri, opts) {
this.lastPing = null;
this.encoding = false;
this.packetBuffer = [];
this.encoder = new parser.Encoder();
this.decoder = new parser.Decoder();
var _parser = opts.parser || parser;
this.encoder = new _parser.Encoder();
this.decoder = new _parser.Decoder();
this.autoConnect = opts.autoConnect !== false;
if (this.autoConnect) this.open();
}
Expand Down

0 comments on commit 40de1ba

Please sign in to comment.