Skip to content

Commit 663d326

Browse files
feat: add support for v3.x clients
In order to ease the migration to Socket.IO v3, the Engine.IO server can now communicate with v3.x clients. ```js const eioServer = require("engine.io")(httpServer, { allowEIO3: true // false by default }); ``` If `allowEIO3` is false, the v3.x clients will now receive an HTTP 400 response ("Unsupported protocol version"). Note: the code of the v3 parser has been imported from [1] and browser-related dependencies were removed. [1]: https://github.com/socketio/engine.io-parser/tree/2.2.1 Related: - socketio/engine.io-protocol#35 - socketio/socket.io-protocol#21
1 parent 9b62152 commit 663d326

17 files changed

+1013
-66
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/parser-v3/

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ to a single process.
252252
- `wsEngine` (`String`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `ws`. An alternative c++ addon is also available by installing `uws` module.
253253
- `cors` (`Object`): the options that will be forwarded to the cors module. See [there](https://github.com/expressjs/cors#configuration-options) for all available options. Defaults to no CORS allowed.
254254
- `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.
255+
- `allowEIO3` (`Boolean`): whether to support v3 Engine.IO clients (defaults to `false`)
255256
- `close`
256257
- Closes all clients
257258
- **Returns** `Server` for chaining

0 commit comments

Comments
 (0)