Skip to content

Commit 40de1ba

Browse files
author
Damien Arrachequesne
committed
Allow the use of a custom parser
See socketio/socket.io#2829
1 parent 1ac8374 commit 40de1ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/manager.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ function Manager (uri, opts) {
6262
this.lastPing = null;
6363
this.encoding = false;
6464
this.packetBuffer = [];
65-
this.encoder = new parser.Encoder();
66-
this.decoder = new parser.Decoder();
65+
var _parser = opts.parser || parser;
66+
this.encoder = new _parser.Encoder();
67+
this.decoder = new _parser.Decoder();
6768
this.autoConnect = opts.autoConnect !== false;
6869
if (this.autoConnect) this.open();
6970
}

0 commit comments

Comments
 (0)