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 withuws
. You can still useuws
by runningnpm install uws --save
in your project and using thewsEngine
option:
var engine = require('engine.io');
var server = engine.listen(3000, {
wsEngine: 'uws'
});
pingTimeout
now defaults to 5 seconds (instead of 60 seconds): socketio/engine.io#551
Links:
- Milestone: 2.1.0
- Diff: 2.0.4...2.1.0
- Client release: 2.1.0
- engine.io version:
~3.2.0
(diff: socketio/engine.io@3.1.0...3.2.0) - ws version:
~3.3.1
(diff: websockets/ws@2.3.1...3.3.1)