Skip to content

Commit

Permalink
[pkg] Update engine.io-client to version 6.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Apr 26, 2022
1 parent 529369e commit 6fe20ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"ejson": "~2.2.0",
"emits": "~3.0.0",
"engine.io": "~6.2.0",
"engine.io-client": "~5.1.1",
"engine.io-client": "~6.2.1",
"faye-websocket": "~0.11.0",
"inherits": "~2.0.3",
"mocha": "~9.0.3",
Expand Down
26 changes: 7 additions & 19 deletions transformers/engine.io/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ module.exports = function client() {
var factory = (function factory() {
if ('undefined' !== typeof eio) return eio;

try { return Primus.requires('engine.io-client'); }
catch (e) {}
try {
var Socket = Primus.requires('engine.io-client').Socket;

return function eio(options) {
return new Socket(options);
}
} catch (e) {}

return undefined;
})();
Expand Down Expand Up @@ -55,15 +60,6 @@ module.exports = function client() {
//
forceBase64: true,

//
// XDR has been the source of pain for most real-time users. It doesn't
// support the full CORS spec and is infested with bugs. It cannot connect
// cross-scheme, does not send ANY authorization information like Cookies,
// Basic Authorization headers etc. Force this off by default to ensure a
// stable connection.
//
enablesXDR: false,

//
// Force timestamps on every single connection. Engine.IO only does this
// for polling by default, but WebSockets require an explicit `true`
Expand All @@ -76,14 +72,6 @@ module.exports = function client() {
: ['polling']
}));

//
// Nuke a growing memory leak as Engine.IO pushes instances in to an exposed
// `sockets` array.
//
if (factory.sockets && factory.sockets.length) {
factory.sockets.length = 0;
}

//
// Setup the Event handlers.
//
Expand Down

0 comments on commit 6fe20ba

Please sign in to comment.