diff --git a/lib/index.js b/lib/index.js index 340366e587..9f73d5faf8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -49,11 +49,11 @@ function Server(srv, opts){ this.nsps = {}; this.path(opts.path || '/socket.io'); this.serveClient(false !== opts.serveClient); + this.parser = opts.parser || parser; + this.encoder = new this.parser.Encoder(); this.adapter(opts.adapter || Adapter); this.origins(opts.origins || '*:*'); this.sockets = this.of('/'); - this.parser = opts.parser || parser; - this.encoder = new this.parser.Encoder(); if (srv) this.attach(srv, opts); } diff --git a/package.json b/package.json index b04574c083..dc8f839f73 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "engine.io": "2.0.2", "has-binary": "0.1.7", "object-assign": "4.1.0", - "socket.io-adapter": "0.5.0", + "socket.io-adapter": "1.0.0", "socket.io-client": "socketio/socket.io-client", "socket.io-parser": "2.3.1" },