sockets
hook for Sails v0.11
Stability: 2 - Stable
This hook's responsibilities are:
- 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.
- listen for get/post/put/delete/patch events
N/A
GET __getcookie
sails.sockets.*
(see reference documentation for sails.sockets on sailsjs.org for full list of exposed methods)
If you have a question that isn't covered here, please feel free to send a PR adding it to this section.
This repo contains a hook, one of the building blocks Sails is made out of.
This hook is a dependency of Sails core as of v0.11.
Yes.
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.
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
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
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.)
MIT