ndx-socket

0.1.3 • Public • Published

ndx-socket

websockets for ndx-framework

install with
npm install --sve ndx-socket

what it does

ndx-socket provides callbacks for socket connection and disconnect

example

src/server/app.coffee

require 'ndx-server'
.config
  database: 'db'
.use 'ndx-socket'
.controller (ndx) ->
  sockets = []
  ndx.socket.on 'connection', (socket) ->
    #do something with the socket
    sockets.push socket
  ndx.socket.on 'disconnect', (socket) ->
    #socket has disconnected
    sockets.splice sockets.indexOf(socket), 1

Readme

Keywords

none

Package Sidebar

Install

npm i ndx-socket

Weekly Downloads

2

Version

0.1.3

License

MIT

Unpacked Size

17.4 kB

Total Files

8

Last publish

Collaborators

  • ndxbxrme