Skip to content

2.1.0

Compare
Choose a tag to compare
@darrachequesne darrachequesne released this 29 Mar 21:54
· 209 commits to master since this release
db831a3

Features

  • add a 'binary' flag (#3185)
// by default, the object is recursively scanned to check whether it contains some binary data
// in the following example, the check is skipped in order to improve performance
socket.binary(false).emit('plain-object', object);

// it also works at the namespace level
io.binary(false).emit('plain-object', object);
  • add support for dynamic namespaces (#3195)
io.of(/^\/dynamic-\d+$/).on('connect', (socket) => {
  // socket.nsp.name = '/dynamic-101'
});

// client-side
const client = require('socket.io-client')('/dynamic-101');

Bug fixes

  • properly emit 'connect' when using a custom namespace (#3197)
  • include the protocol in the origins check (#3198)

Important note ⚠️ from Engine.IO 3.2.0 release

There are two non-breaking changes that are somehow quite important:

  • ws was reverted as the default wsEngine (socketio/engine.io#550), as there was several blocking issues with uws. You can still use uws by running npm install uws --save in your project and using the wsEngine option:
var engine = require('engine.io');
var server = engine.listen(3000, {
  wsEngine: 'uws'
});

Links: