diff --git a/lib/manager.js b/lib/manager.js index b08482a84..fc56a7d35 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -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(); }