Skip to content

Commit b9ab640

Browse files
committed
Register fastify's websocket plugin
1 parent ad4304e commit b9ab640

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@fastify/compress": "^8.0.1",
3636
"@fastify/cookie": "^11.0.1",
3737
"@fastify/cors": "^11.0.1",
38+
"@fastify/websocket": "^11.0.2",
3839
"@ffprobe-installer/ffprobe": "^2.1.2",
3940
"@golevelup/nestjs-discovery": "^4.0.0",
4041
"@graphql-hive/yoga": ">=0.41.0",

src/core/http/http.adapter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import compression from '@fastify/compress';
22
import cookieParser from '@fastify/cookie';
33
import cors from '@fastify/cors';
4+
import websocket from '@fastify/websocket';
45
import { DiscoveryService } from '@golevelup/nestjs-discovery';
56
import {
67
VERSION_NEUTRAL,
@@ -65,6 +66,8 @@ export class HttpAdapter extends PatchedFastifyAdapter {
6566
// Only on routes we've decorated.
6667
await app.register(rawBody, { global: false });
6768

69+
await app.register(websocket);
70+
6871
app.setGlobalPrefix(config.hostUrl$.value.pathname.slice(1));
6972

7073
config.applyTimeouts(app.getHttpServer(), config.httpTimeouts);

yarn.lock

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,17 @@ __metadata:
14251425
languageName: node
14261426
linkType: hard
14271427

1428+
"@fastify/websocket@npm:^11.0.2":
1429+
version: 11.0.2
1430+
resolution: "@fastify/websocket@npm:11.0.2"
1431+
dependencies:
1432+
duplexify: "npm:^4.1.3"
1433+
fastify-plugin: "npm:^5.0.0"
1434+
ws: "npm:^8.16.0"
1435+
checksum: 10c0/ccdaf645d768f427542d5133d3a0f8b4ce49e4bc2496543e1fb6f1d4b8c4e07af6fb80bde7bf50acf7536cb35c839c54d94a0a6b6f1aec76d413f0e68b92e04e
1436+
languageName: node
1437+
linkType: hard
1438+
14281439
"@ffprobe-installer/darwin-arm64@npm:5.0.1":
14291440
version: 5.0.1
14301441
resolution: "@ffprobe-installer/darwin-arm64@npm:5.0.1"
@@ -5816,6 +5827,7 @@ __metadata:
58165827
"@fastify/compress": "npm:^8.0.1"
58175828
"@fastify/cookie": "npm:^11.0.1"
58185829
"@fastify/cors": "npm:^11.0.1"
5830+
"@fastify/websocket": "npm:^11.0.2"
58195831
"@ffprobe-installer/ffprobe": "npm:^2.1.2"
58205832
"@gel/generate": "npm:^0.7.0-canary.20250422T080308"
58215833
"@golevelup/nestjs-discovery": "npm:^4.0.0"
@@ -6482,7 +6494,7 @@ __metadata:
64826494
languageName: node
64836495
linkType: hard
64846496

6485-
"duplexify@npm:^4.1.1":
6497+
"duplexify@npm:^4.1.1, duplexify@npm:^4.1.3":
64866498
version: 4.1.3
64876499
resolution: "duplexify@npm:4.1.3"
64886500
dependencies:
@@ -14286,7 +14298,7 @@ __metadata:
1428614298
languageName: node
1428714299
linkType: hard
1428814300

14289-
"ws@npm:8.18.1, ws@npm:^8.17.1":
14301+
"ws@npm:8.18.1, ws@npm:^8.16.0, ws@npm:^8.17.1":
1429014302
version: 8.18.1
1429114303
resolution: "ws@npm:8.18.1"
1429214304
peerDependencies:

0 commit comments

Comments
 (0)