Interface WebSocketServer
Properties
clients
off
off
: { (event
: "connection", cb
: (this
: Server<WebSocket>, socket
: WebSocket, request
: IncomingMessage) => void): Server<WebSocket>; (event
: "error", cb
: (this
: Server<WebSocket>, error
: Error) => void): Server<WebSocket>; (event
: "headers", cb
: (this
: Server<WebSocket>, headers
: string[], request
: IncomingMessage) => void): Server<WebSocket>; (event
: "close" | "listening", cb
: (this
: Server<WebSocket>) => void): Server<WebSocket>; (event
: string | symbol, listener
: (this
: Server<WebSocket>,
...args
: any[]) => void): Server<WebSocket> } & ((event
: string, listener
: Function) => void)on
on
: { (event
: "connection", cb
: (this
: Server<WebSocket>, socket
: WebSocket, request
: IncomingMessage) => void): Server<WebSocket>; (event
: "error", cb
: (this
: Server<WebSocket>, error
: Error) => void): Server<WebSocket>; (event
: "headers", cb
: (this
: Server<WebSocket>, headers
: string[], request
: IncomingMessage) => void): Server<WebSocket>; (event
: "close" | "listening", cb
: (this
: Server<WebSocket>) => void): Server<WebSocket>; (event
: string | symbol, listener
: (this
: Server<WebSocket>,
...args
: any[]) => void): Server<WebSocket> } & (<T>(event
: T, listener
: WebSocketCustomListener<InferCustomEventPayload<T>>) => void)Methods
close
Returns Promise<void>
listen
Returns void
send
Parameters
Returns void
Type parameters
Parameters
Returns void
Get all connected clients.