Skip to content

Commit 898bd1c

Browse files
chore(release): 6.4.0
Diff: 6.3.1...6.4.0
1 parent 6220d14 commit 898bd1c

File tree

4 files changed

+59
-10
lines changed

4 files changed

+59
-10
lines changed

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 2023
44

5+
- [6.4.0](#640-2023-02-06) (Feb 2023)
56
- [6.3.1](#631-2023-01-12) (Jan 2023)
67
- [6.3.0](#630-2023-01-10) (Jan 2023)
78

@@ -44,9 +45,57 @@
4445

4546
# Release notes
4647

48+
## [6.4.0](https://github.com/socketio/engine.io/compare/6.3.1...6.4.0) (2023-02-06)
49+
50+
51+
### Features
52+
53+
* add support for Express middlewares ([24786e7](https://github.com/socketio/engine.io/commit/24786e77c5403b1c4b5a2bc84e2af06f9187f74a))
54+
55+
This commit implements middlewares at the Engine.IO level, because Socket.IO middlewares are meant for namespace authorization and are not executed during a classic HTTP request/response cycle.
56+
57+
A workaround was possible by using the allowRequest option and the "headers" event, but this feels way cleaner and works with upgrade requests too.
58+
59+
Syntax:
60+
61+
```js
62+
engine.use((req, res, next) => {
63+
// do something
64+
65+
next();
66+
});
67+
68+
// with express-session
69+
import session from "express-session";
70+
71+
engine.use(session({
72+
secret: "keyboard cat",
73+
resave: false,
74+
saveUninitialized: true,
75+
cookie: { secure: true }
76+
}));
77+
78+
// with helmet
79+
import helmet from "helmet";
80+
81+
engine.use(helmet());
82+
```
83+
84+
85+
### Dependencies
86+
87+
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
88+
89+
90+
4791
## [6.3.1](https://github.com/socketio/engine.io/compare/6.3.0...6.3.1) (2023-01-12)
4892

4993

94+
### Dependencies
95+
96+
- [`ws@~8.11.0`](https://github.com/websockets/ws/releases/tag/8.11.0) (no change)
97+
98+
5099

51100
## [6.3.0](https://github.com/socketio/engine.io/compare/6.2.1...6.3.0) (2023-01-10)
52101

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "engine.io",
3-
"version": "6.3.1",
3+
"version": "6.4.0",
44
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
55
"type": "commonjs",
66
"main": "./build/engine.io.js",
@@ -45,7 +45,7 @@
4545
"devDependencies": {
4646
"babel-eslint": "^8.0.2",
4747
"eiows": "^4.1.2",
48-
"engine.io-client": "6.3.0",
48+
"engine.io-client": "6.4.0",
4949
"engine.io-client-v3": "npm:[email protected]",
5050
"expect.js": "^0.3.1",
5151
"express-session": "^1.17.3",

test/engine.io.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("engine", () => {
1414
expect(protocol).to.be.a("number");
1515
});
1616

17-
it.skip("should be the same version as client", () => {
17+
it("should be the same version as client", () => {
1818
const version = require("../package.json").version;
1919
expect(version).to.be(require("engine.io-client/package.json").version);
2020
});

0 commit comments

Comments
 (0)