Methods
public addListener( event: string , listener: () => void ) : server
Parameters
event: string
listener: () => void
Returns
server
public addListener( event: "'request'" , cb: (request: "websocket".request) => void ) : server
Parameters
event: "'request'"
cb: (request: "websocket".request) => void
Returns
server
public addListener( event: "'connect'" , cb: (connection: "websocket".connection) => void ) : server
Parameters
event: "'connect'"
cb: (connection: "websocket".connection) => void
Returns
server
public addListener( event: "'close'" , cb: (connection: "websocket".connection, reason: number, desc: string) => void ) : server
Parameters
event: "'close'"
cb: (connection: "websocket".connection, reason: number, desc: string) => void
Returns
server
public broadcast( data: Buffer )
Defined in cket/websocket.d.ts:130
Send binary message for each connection
Parameters
Defined in cket/websocket.d.ts:132
Send UTF-8 message for each connection
Parameters
public broadcastBytes( data: Buffer )
Defined in cket/websocket.d.ts:134
Send binary message for each connection
Parameters
public broadcastUTF( data: IStringified )
Defined in cket/websocket.d.ts:136
Send UTF-8 message for each connection
Parameters
public closeAllConnections( )
Defined in cket/websocket.d.ts:148
Close all open WebSocket connections
public emit( event: string , args?: Array<any> ) : boolean
Parameters
event: string
args?: Array<any> optional
Returns
boolean
public listeners( event: string ) : Array<Function>
Parameters
Returns
Array<Function>
public mount( serverConfig: IServerConfig )
Defined in cket/websocket.d.ts:138
Attach the server
instance to a Node http.Server instance
Parameters
public on( event: string , listener: () => void ) : server
Parameters
event: string
listener: () => void
Returns
server
public on( event: "'request'" , cb: (request: "websocket".request) => void ) : server
Parameters
event: "'request'"
cb: (request: "websocket".request) => void
Returns
server
public on( event: "'connect'" , cb: (connection: "websocket".connection) => void ) : server
Parameters
event: "'connect'"
cb: (connection: "websocket".connection) => void
Returns
server
public on( event: "'close'" , cb: (connection: "websocket".connection, reason: number, desc: string) => void ) : server
Parameters
event: "'close'"
cb: (connection: "websocket".connection, reason: number, desc: string) => void
Returns
server
public once( event: string , listener: Function ) : EventEmitter
Parameters
event: string
listener: Function
Returns
EventEmitter
public removeListener( event: string , listener: Function ) : EventEmitter
Parameters
event: string
listener: Function
Returns
EventEmitter
public setMaxListeners( n: number )
Parameters
public shutDown( )
Defined in cket/websocket.d.ts:150
Close all open WebSocket connections and unmount the server
public unmount( )
Defined in cket/websocket.d.ts:145
Detach the server
instance from the Node http.Server instance.
All existing connections are left alone and will not be affected,
but no new WebSocket connections will be accepted.