@krknet/socket-server
v2.1.0
Published
> Wrapper around Socket.io
Downloads
4
Readme
SocketServer
Wrapper around Socket.io
Usage
const SocketServer = require('@krknet/socket-server')
const socketServer = new SocketServer(httpServer.rawServer, { initiatiors: [] })
global.__sockets = socketServer
await socketServer.start()
console.log(socketServer.isRunning)
await socketServer.stop()
Client Path: node_modules/socket.io/client-dist/socket.io.js Production Client Path: node_modules/socket.io/client-dist/socket.io.min.js
Options
{
initiatiors: [],
doLog: true,
path: '/ws'
}
Functions
async start ()
emit (...params)
of (ns)
in (room)
to (recipient)
async stop ()