Socket.io v2.1.0 Release Notes

Release Date: 2018-03-29 // about 6 years ago
  • ๐Ÿ”‹ 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 performancesocket.binary(false).emit('plain-object', object);// it also works at the namespace levelio.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-sideconst 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'});

    • 0๏ธโƒฃ pingTimeout now defaults to 5 seconds (instead of 60 seconds): socketio/engine.io#551

    Milestone: 2.1.0
    Diff: 2.0.4...2.1.0
    Engine.IO version: 3.2.x