Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
class WebSocketServer
Re-export
import { WebSocketServer } from "https://deno.land/x/sptaki@1.2.0/servers/mod.ts";

Constructors

new
WebSocketServer(
logger: ILogger,
randomUtil: RandomUtil,
configServer: ConfigServer,
localisationService: LocalisationService,
jsonUtil: JsonUtil,
httpServerHelper: HttpServerHelper,
profileHelper: ProfileHelper,
)

Properties

protected
configServer: ConfigServer
protected
defaultNotification: INotification
protected
httpConfig: IHttpConfig
protected
httpServerHelper: HttpServerHelper
protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService
protected
logger: ILogger
protected
profileHelper: ProfileHelper
protected
randomUtil: RandomUtil
protected
websocketPingHandler: any
protected
webSockets: Record<string, WebSocket.WebSocket>
protected
webSocketServer: WebSocket.Server

Methods

protected
getRandomisedMessage(): string
protected
wsOnConnection(ws: WebSocket.WebSocket, req: IncomingMessage): void
getSessionWebSocket(sessionID: string): WebSocket.WebSocket
getWebSocketServer(): WebSocket.Server
isConnectionWebSocket(sessionID: string): boolean
sendMessage(sessionID: string, output: INotification): void
setupWebSocket(httpServer: http.Server): void