noobaa / noobaa-core

High-performance S3 application gateway to any backend - file / s3-compatible / multi-clouds / caching / replication ...
https://www.noobaa.io
Apache License 2.0
273 stars 80 forks source link

noobaa/core: remove global websocket #8514

Closed aspandey closed 1 week ago

aspandey commented 2 weeks ago

Prep PR for node 22

In node v22, websocket is enabled by default https://github.com/nodejs/node/pull/51594

This will cause an error on following line when the global.Websocket would be true. const WS = global.WebSocket || require('ws');

global.WebSocket: This will points to Node.js's native WebSocket, which does not include a Server class. require('ws'): The ws package includes both WebSocket and WebSocket.Server, but this fallback is skipped because global.WebSocket is already defined in Node.js v22