-import type { IncomingMessage } from 'http';
-import type internal from 'stream';
-
-import { StatusCodes } from 'http-status-codes';
-import WebSocket, { type RawData, WebSocketServer } from 'ws';
-
-import type { UIServerConfiguration } from '../../types/ConfigurationData';
-import type { ProtocolRequest, ProtocolResponse } from '../../types/UIProtocol';
-import { WebSocketCloseEventStatusCode } from '../../types/WebSocket';
-import logger from '../../utils/Logger';
-import Utils from '../../utils/Utils';
-import { AbstractUIServer } from './AbstractUIServer';
-import { UIServerUtils } from './UIServerUtils';
-
-const moduleName = 'UIWebSocketServer';
-
-export default class UIWebSocketServer extends AbstractUIServer {
- private readonly webSocketServer: WebSocketServer;
-
- public constructor(protected readonly uiServerConfiguration: UIServerConfiguration) {
- super(uiServerConfiguration);
+import type { IncomingMessage } from 'node:http'
+import type { Duplex } from 'node:stream'
+
+import { StatusCodes } from 'http-status-codes'
+import { type RawData, WebSocket, WebSocketServer } from 'ws'
+
+import { AbstractUIServer } from './AbstractUIServer.js'
+import { UIServerUtils } from './UIServerUtils.js'
+import {
+ type ProtocolRequest,
+ type ProtocolResponse,
+ type UIServerConfiguration,
+ WebSocketCloseEventStatusCode
+} from '../../types/index.js'
+import {
+ Constants,
+ getWebSocketCloseEventStatusString,
+ isNotEmptyString,
+ logPrefix,
+ logger,
+ validateUUID
+} from '../../utils/index.js'
+
+const moduleName = 'UIWebSocketServer'
+
+export class UIWebSocketServer extends AbstractUIServer {
+ private readonly webSocketServer: WebSocketServer
+
+ public constructor (protected readonly uiServerConfiguration: UIServerConfiguration) {
+ super(uiServerConfiguration)