sails-hook-sockets
Implements socket.io support in Sails
Last updated 7 years ago by mikermcneil .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install sails-hook-sockets 
SYNC missed versions from official npm registry.

sockets

sockets hook for Sails v0.11

Status

Stability: 2 - Stable

Purpose

This hook's responsibilities are:

When initialized...

  • fire up socket.io server
  • listen for connect / disconnect events
    • listen for get/post/put/delete/patch events
      • create bare-bones request and response contexts, then pass them to the core interpreter in Sails to be routed on the fly.

Bind "shadow" routes...

before

N/A

after
  • GET __getcookie

Expose on the sails app object:

  • sails.sockets.* (see reference documentation for sails.sockets on sailsjs.org for full list of exposed methods)

FAQ

If you have a question that isn't covered here, please feel free to send a PR adding it to this section.

What is this?

This repo contains a hook, one of the building blocks Sails is made out of.

What version of Sails is this for?

This hook is a dependency of Sails core as of v0.11.

Does this hook use Socket.io v1.0?

Yes.

Are there changes?

Yes, see the v0.11 migration guide. You probably won't need to change anything unless you were extensively using the old Socket.io v0.9 configuration.

Running the tests

First, clone this repo, cd into it, and install dependencies:

git clone https://github.com/balderdashy/sails-hook-sockets.git
cd sails-hook-sockets
npm install

Run them all

To run all the tests, start a local redis server on port 6380 and then run the tests using mocha:

redis-server --port 6380
npm test

Run only certain tests

Alternatively, you can run a particular set of tests with:

node ./node_modules/mocha/bin/mocha -g 'without session'

(this may be useful if you don't want to wait for all the tests to run, or e.g. if you aren't able to install a redis server locally. However please make sure all the tests pass before submitting a PR.)

License

MIT

Current Tags

  • 0.13.14                                ...           for-sails-0.12 (7 years ago)
  • 3.0.0                                ...           latest (a year ago)
  • 0.11.29                                ...           patch-v11-socketio (9 years ago)

78 Versions

  • 3.0.0                                ...           a year ago
  • 2.0.4                                ...           a year ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           6 years ago
  • 2.0.0-0                                ...           6 years ago
  • 1.5.5                                ...           6 years ago
  • 1.5.4                                ...           6 years ago
  • 1.5.3                                ...           6 years ago
  • 1.5.2                                ...           7 years ago
  • 0.13.14                                ...           7 years ago
  • 1.5.2-2                                ...           7 years ago
  • 1.5.2-1                                ...           7 years ago
  • 0.13.14-0                                ...           7 years ago
  • 1.5.2-0                                ...           7 years ago
  • 1.5.1                                ...           7 years ago
  • 1.5.0                                ...           7 years ago
  • 0.13.13                                ...           7 years ago
  • 0.13.12                                ...           7 years ago
  • 1.4.3                                ...           8 years ago
  • 1.4.2                                ...           8 years ago
  • 1.4.1                                ...           8 years ago
  • 1.4.0                                ...           8 years ago
  • 1.3.4                                ...           8 years ago
  • 0.13.11                                ...           8 years ago
  • 0.13.10                                ...           8 years ago
  • 1.3.3                                ...           8 years ago
  • 1.3.2                                ...           8 years ago
  • 1.3.1                                ...           8 years ago
  • 1.3.0                                ...           8 years ago
  • 1.2.3                                ...           8 years ago
  • 1.2.2                                ...           8 years ago
  • 1.2.1                                ...           8 years ago
  • 1.2.0                                ...           8 years ago
  • 1.1.0                                ...           8 years ago
  • 0.13.9                                ...           8 years ago
  • 0.13.9-0                                ...           8 years ago
  • 1.0.1                                ...           8 years ago
  • 0.13.8                                ...           8 years ago
  • 0.13.7                                ...           9 years ago
  • 0.13.6                                ...           9 years ago
  • 0.13.5                                ...           9 years ago
  • 0.13.4                                ...           9 years ago
  • 0.13.3                                ...           9 years ago
  • 0.13.0                                ...           9 years ago
  • 0.11.29                                ...           9 years ago
  • 0.12.3                                ...           9 years ago
  • 0.12.2                                ...           9 years ago
  • 0.12.1                                ...           9 years ago
  • 0.12.0                                ...           9 years ago
  • 0.11.28                                ...           9 years ago
  • 0.11.27                                ...           9 years ago
  • 0.11.26                                ...           9 years ago
  • 0.11.25                                ...           9 years ago
  • 0.11.24                                ...           9 years ago
  • 0.11.23                                ...           10 years ago
  • 0.11.21                                ...           10 years ago
  • 0.11.20                                ...           10 years ago
  • 0.11.19                                ...           10 years ago
  • 0.11.18                                ...           10 years ago
  • 0.11.17                                ...           10 years ago
  • 0.11.16                                ...           10 years ago
  • 0.11.15                                ...           10 years ago
  • 0.11.13                                ...           10 years ago
  • 0.11.12                                ...           10 years ago
  • 0.11.11                                ...           10 years ago
  • 0.11.10                                ...           10 years ago
  • 0.11.9                                ...           10 years ago
  • 0.11.8                                ...           10 years ago
  • 0.11.7                                ...           10 years ago
  • 0.11.6                                ...           10 years ago
  • 0.11.5                                ...           10 years ago
  • 0.11.4                                ...           10 years ago
  • 0.11.3                                ...           10 years ago
  • 0.11.2                                ...           10 years ago
  • 0.11.1                                ...           10 years ago
  • 0.11.0                                ...           10 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE