diff --git a/lib/socket.js b/lib/socket.js index 246ade5cb..3322c361b 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -121,18 +121,18 @@ class Socket extends Emitter { if (this.id) query.sid = this.id; const opts = Object.assign( + {}, + this.opts.transportOptions[name], + this.opts, { query, socket: this, hostname: this.hostname, secure: this.secure, port: this.port - }, - this.opts.transportOptions[name], - this.opts + } ); - // console.log(opts); debug("options: %j", opts); return new transports[name](opts); diff --git a/lib/transports/polling-xhr.js b/lib/transports/polling-xhr.js index 91a1cfd59..93648a7f7 100755 --- a/lib/transports/polling-xhr.js +++ b/lib/transports/polling-xhr.js @@ -102,6 +102,7 @@ class XHR extends Polling { req.on("error", function(err) { self.onError("xhr poll error", err); }); + this.pollXhr = req; } }