GithubHelp home page GithubHelp logo

isabella232 / sails-hook-sockets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balderdashy/sails-hook-sockets

0.0 0.0 0.0 400 KB

Implements socket.io support in Sails.

Home Page: http://sailsjs.com/documentation/concepts/realtime

JavaScript 100.00%

sails-hook-sockets's Introduction

sails-hook-sockets

Implements Socket.io support in Sails.

This is a core hook in the Sails.js framework. You can override or disable it using your .sailsrc file or environment variables. See Concepts > Configuration for more information.

Help

If you have further questions or are having trouble, click here.

What version of Sails is this for?

This hook is for Sails v1.0 and up.

Prior to Sails v1.0, this hook was a dependency of Sails core. But now, it is now installed as a direct dependency of your Sails app.

What is this? What does it do?

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

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 after "shadow" routes...
      • GET /__getcookie
    • Expose on the sails app object:

What version of Socket.io does this hook use?

Click here to check out the semver range for this hook's Socket.io dependency.

For reproducibility, we always pin 3rd party dependencies to a specific version, using a consistent verified version string when possible (see kit).

Bugs   NPM version

To report a bug, click here.

Contributing

Please observe the guidelines and conventions laid out in the Sails project contribution guide when opening issues or submitting pull requests.

NPM

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 --requirepass 'secret'
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

The Sails framework is free and open-source under the MIT License.

sails-hook-sockets's People

Contributors

mikermcneil avatar sgress454 avatar rachaelshaw avatar maelstrom96 avatar jeremy-albuixech avatar luislobo avatar bberry6 avatar ajoslin avatar arryon avatar blastz avatar listepo avatar jmhooper avatar salakar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.