You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nodulator-socket

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodulator-socket

Nodulator-Socket

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

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

Nodulator.Run()

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

02/01/15: v0.0.2

  • Improved README

30/12/14: v0.0.1

  • Initial commit

FAQs

Package last updated on 02 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts