Skip to content

Commit

Permalink
refactor: adjust types for websockets
Browse files Browse the repository at this point in the history
  • Loading branch information
rsdmike committed Dec 12, 2024
1 parent 913a632 commit b938bf7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/webserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { type certificatesType } from '../models/Config.js'
import { ErrorResponse } from '../utils/amtHelper.js'
import { logger, messages } from '../logging/index.js'
import routes from '../routes/index.js'
import WebSocket from 'ws'
import { WebSocketServer, ServerOptions, WebSocket } from 'ws'
import { URL, fileURLToPath, pathToFileURL } from 'node:url'
import cors from 'cors'
import { lstatSync, existsSync, readdirSync } from 'node:fs'
Expand All @@ -32,7 +32,7 @@ import path from 'node:path'
export class WebServer {
app: express.Express
server: Server = null
relayWSS: WebSocket.Server = null
relayWSS: WebSocketServer = null
secrets: ISecretManagerService
certs: certificatesType
// to unit test code
Expand All @@ -49,11 +49,11 @@ export class WebServer {
this.certs = certs
this.app = express()

const options: WebSocket.ServerOptions = {
const options: ServerOptions = {
noServer: true,
verifyClient: (info) => this.verifyClientToken(info)
}
this.relayWSS = new WebSocket.Server(options)
this.relayWSS = new WebSocketServer(options)

// Create Server
this.server = createServer(this.app)
Expand Down

0 comments on commit b938bf7

Please sign in to comment.