A realtime application framework for building Web API based on WebSocket
Signal.IO is a realtime application framewrork for building Web API based on WebSocket instead of HTTP.
var signal = require'signal.io';var server = require'http'Server;var io = signalserver;ioconnect'/'socketon'get'ressend'Hello World';;;serverlisten3000;
$ npm install signal.io
- Built on Socket.IO v1.0
- Express inspired API and interface
- Namespace routing
- Bundled middlewares
- Easy broadcasting
var signal = require'signal.io';var server = require'http'Server;var io = signalserver;// set middlewaresiousesignalcookieParser;iousesignalsession'my secret';ioconnect'/posts/:postId'socketon'read'var post = id: reqparamspostId title: 'A post';ressendpost;;socketon'update'var post = reqbody;// do update ...// send back the result and broadcast it to all clients joined in the same namespace.resbroadcastsendpost;;;serverlisten3000;
Use Socket.IO as the client.