nodulator-socket
Nodulator-Socket
Last updated 6 years ago by champii .
0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install nodulator-socket 
SYNC missed versions from official npm registry.

Nodulator-Socket

Socket.io module implementation for Nodulator

Concept

Provides server-side socket.io implementation for Nodulator


Features

  • General implementation for socket.io
  • Room system
  • Link with passport session

JumpTo


Installation

You can automaticaly install Nodulator and Nodulator-Socket by running

$> sudo npm install -g Nodulator
$> Nodulator install socket

Or you can just run npm :

$> npm install nodulator nodulator-socket

Basics

Nodulator = require 'nodulator'
Socket = require 'nodulator-socket'

Nodulator.Use Socket

It adds Nodulator.Socket() function that you can extend

This interface provides 2 methods to override :

  • @OnConnect(socket)
  • @OnDisconnect(socket)
Nodulator = require 'nodulator'

class Socket extends Nodulator.Socket()

  OnConnect: (socket) ->
    console.log 'Socket connected: ', socket

Socket.Init()

module.exports = Socket

Rooms

Each time a Resource is initialized, it create a new room and place each new connecting sockets into it.

Then it listen for every Resource events (new_{resource_name}, update_{resource_name}, delete_{resource_name}) and broadcast theses to the attached room (and so to each sockets)

(See Nodulator Bus)


Project Generation

See Nodulator's project generation

When calling $> Nodulator init, it will automaticaly create following structure if non-existant:

server
└─ sockets
  └─ index.coffee

The index.coffee file is a pre-extended Nodulator.Socket() class


TODO

  • Repair passport session and socket.io match system (passportSocketIO)
  • Provide a filter to apply permissions on specific resource room

Changelog

03/01/15: v0.0.3

02/01/15: v0.0.2

  • Improved README

30/12/14: v0.0.1

  • Initial commit

Current Tags

  • 0.0.2                                ...           latest (6 years ago)

2 Versions

  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |