跳到主要内容

Socket.IO 2.0.0

· 1 分钟阅读
Damien Arrachequesne

Socket.IO 2.0.0 is finally here!

This major release brings several performance improvements:

  • uws is now the default Websocket engine. It should bring significant improvement in performance (particularly in terms of memory consumption) (release note of Engine.IO)

  • the Engine.IO and Socket.IO handshake packets were merged, reducing the number of roundtrips necessary to establish a connection. (#2833)

  • it is now possible to provide a custom parser according to the needs of your application (#2829). Please take a look at the example for more information.

Please note that this release is not backward-compatible, due to:

  • a breaking change related to utf-8 encoding in engine.io-parser

  • an update to make the socket id on the client match the id on the server-side (#1058)

Related packages were updated accordingly:

  • socket.io-redis version 5.x

  • socket.io-emitter version 3.x

Get the latest client from the CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.1/socket.io.js"></script>