engine.io
Advanced tools
Comparing version 4.1.1 to 5.0.0
@@ -0,1 +1,36 @@ | ||
# [5.0.0](https://github.com/socketio/engine.io/compare/4.1.1...5.0.0) (2021-03-10) | ||
### Bug Fixes | ||
* set default protocol version to 3 ([#616](https://github.com/socketio/engine.io/issues/616)) ([868d891](https://github.com/socketio/engine.io/commit/868d89111de0ab5bd0e147ecaff7983afbf5d087)) | ||
### Features | ||
* increase the default value of pingTimeout ([5a7fa13](https://github.com/socketio/engine.io/commit/5a7fa132c442bc1e7eefa1cf38168ee951575ded)) | ||
* remove dynamic require() with wsEngine ([edb7343](https://github.com/socketio/engine.io/commit/edb734316f143bf0f1bbc344e966d18e2676b934)) | ||
### BREAKING CHANGES | ||
* the syntax of the "wsEngine" option is updated | ||
Before: | ||
```js | ||
const eioServer = require("engine.io")(httpServer, { | ||
wsEngine: "eiows" | ||
}); | ||
``` | ||
After: | ||
```js | ||
const eioServer = require("engine.io")(httpServer, { | ||
wsEngine: require("eiows").Server | ||
}); | ||
``` | ||
## [4.1.1](https://github.com/socketio/engine.io/compare/4.1.0...4.1.1) (2021-02-02) | ||
@@ -2,0 +37,0 @@ |
@@ -10,2 +10,4 @@ const qs = require("querystring"); | ||
const DEFAULT_WS_ENGINE = require("ws").Server; | ||
class Server extends EventEmitter { | ||
@@ -26,4 +28,4 @@ /** | ||
{ | ||
wsEngine: process.env.EIO_WS_ENGINE || "ws", | ||
pingTimeout: 5000, | ||
wsEngine: DEFAULT_WS_ENGINE, | ||
pingTimeout: 20000, | ||
pingInterval: 25000, | ||
@@ -81,6 +83,3 @@ upgradeTimeout: 10000, | ||
// add explicit require for bundlers like webpack | ||
const wsModule = | ||
this.opts.wsEngine === "ws" ? require("ws") : require(this.opts.wsEngine); | ||
this.ws = new wsModule.Server({ | ||
this.ws = new this.opts.wsEngine({ | ||
noServer: true, | ||
@@ -235,3 +234,3 @@ clientTracking: false, | ||
async handshake(transportName, req) { | ||
const protocol = req._query.EIO === "3" ? 3 : 4; // 4th revision by default | ||
const protocol = req._query.EIO === "4" ? 4 : 3; // 3rd revision by default | ||
if (protocol === 3 && !this.opts.allowEIO3) { | ||
@@ -238,0 +237,0 @@ debug("unsupported protocol version"); |
@@ -25,4 +25,4 @@ const EventEmitter = require("events"); | ||
this.discarded = false; | ||
this.protocol = req._query.EIO === "3" ? 3 : 4; // 4th revision by default | ||
this.parser = this.protocol === 3 ? parser_v3 : parser_v4; | ||
this.protocol = req._query.EIO === "4" ? 4 : 3; // 3rd revision by default | ||
this.parser = this.protocol === 4 ? parser_v4 : parser_v3; | ||
} | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "engine.io", | ||
"version": "4.1.1", | ||
"version": "5.0.0", | ||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", | ||
@@ -39,3 +39,3 @@ "main": "lib/engine.io.js", | ||
"eiows": "^3.3.0", | ||
"engine.io-client": "4.1.1", | ||
"engine.io-client": "5.0.0", | ||
"engine.io-client-v3": "npm:engine.io-client@3.5.0", | ||
@@ -42,0 +42,0 @@ "eslint": "^4.19.1", |
@@ -191,3 +191,3 @@ | ||
const server = engine.attach(httpServer, { | ||
wsEngine: 'uws' // requires having uws as dependency | ||
wsEngine: require('eiows').Server // requires having eiows as dependency | ||
}); | ||
@@ -226,3 +226,3 @@ | ||
- `pingTimeout` (`Number`): how many ms without a pong packet to | ||
consider the connection closed (`5000`) | ||
consider the connection closed (`20000`) | ||
- `pingInterval` (`Number`): how many ms before sending a new ping | ||
@@ -254,3 +254,3 @@ packet (`25000`) | ||
See [here](https://github.com/jshttp/cookie#options-1) for all supported options. | ||
- `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. | ||
- `wsEngine` (`Function`): 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 `eiows` module. | ||
- `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. | ||
@@ -257,0 +257,0 @@ - `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO. |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
94600
0
2280