-import type { IncomingMessage } from 'http';
-import type { Duplex } from 'stream';
+import type { IncomingMessage } from 'node:http';
+import type { Duplex } from 'node:stream';
import { StatusCodes } from 'http-status-codes';
import WebSocket, { type RawData, WebSocketServer } from 'ws';
type UIServerConfiguration,
WebSocketCloseEventStatusCode,
} from '../../types';
-import { Utils, logger } from '../../utils';
+import { Constants, Utils, logger } from '../../utils';
import { AbstractUIServer, UIServerUtils } from '../internal';
const moduleName = 'UIWebSocketServer';
}
const [requestId] = request as ProtocolRequest;
this.responseHandlers.set(requestId, ws);
- this.uiServices
- .get(version)
- ?.requestHandler(request)
- .catch(() => {
- /* Error caught by AbstractUIService */
- });
+ this.uiServices.get(version)?.requestHandler(request).catch(Constants.EMPTY_FUNCTION);
});
ws.on('error', (error) => {
logger.error(`${this.logPrefix(moduleName, 'start.ws.onerror')} WebSocket error:`, error);