Added missing WebSocket import

This commit is contained in:
RemixDev 2022-02-05 09:50:42 +01:00
parent 9ff4aeace5
commit 174f7b999b

View File

@ -1,6 +1,6 @@
import http, { Server } from 'http' import http, { Server } from 'http'
import express, { Application } from 'express' import express, { Application } from 'express'
import { Server as WsServer } from 'ws' import { Server as WsServer, OPEN as WsOpen } from 'ws'
import initDebug from 'debug' import initDebug from 'debug'
// @ts-expect-error // @ts-expect-error
import deemix from 'deemix' import deemix from 'deemix'
@ -37,7 +37,7 @@ export class DeemixServer {
if (logLine) console.log(logLine) if (logLine) console.log(logLine)
if (['downloadInfo', 'downloadWarn'].includes(key)) return if (['downloadInfo', 'downloadWarn'].includes(key)) return
this.wss.clients.forEach(client => { this.wss.clients.forEach(client => {
if (client.readyState === WebSocket.OPEN) { if (client.readyState === WsOpen) {
client.send(JSON.stringify({ key, data })) client.send(JSON.stringify({ key, data }))
} }
}) })