Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (49 sloc) 2.351 kB


is a highly scalable and fault tolerant COMET solution with a shared nothing architecture built on top of, connect and noderpc. There is no single point of failure. is used for client connections. It offers services for

  • user authentication
  • channel pub/sub
  • multiple socket connections per user

Each service is fully shardeable via noderpc. This means, there can be several independant nodes for handling user connections, channel management and auth service and even completely independant and fault tolerant management nodes that maybe fully loadbalanced.


npm install socket-push


For a demo, simply download and start with "node server.js". Start your browser with


  1. Register a user in the management interface with auth set, e.g. userId 1 and sessionId test
  2. Use the same userId + sessionId in the client interface to start a session
  3. Do a user/publish on userId 1 with a message of your choice

Management API

The management API can be addressed via

  • HTTP directly
  • node.js objects
  • PHP

In fact, the server uses its own client API internally for sharding and distributing requests. In rpc/bindings/php is an API generator for PHP which generates PHP classes to access the management API.

Client bindings

In node.js it looks like this:

var authServiceDefinition = require('service/auth.js');
var authService = new (require('rpc/proxy/http'))(authServiceDefinition, '', 8181);
authService.set(1, 'test', function(resultOnSuccess) {}, function(exception) {});

In PHP it looks like this:

First generate Service class

rpc/bindings/php> generateApi.php -h -p 8181


$authService = new NodeRPC_Auth_Service('', 8181);
$authService->set(1, 'test');

The API, literally speaking naming of services, methods and parameters is consistent across the client APIs in node.js, PHP and via HTTP.


  • worker.heartbeat method ** elect spare workers on node down
  • abstraction for distributed config, node and election strategy
  • allow client to subscribe to channels optionally
  • optionally subscribe to channel as session instead of user
Jump to Line
Something went wrong with that request. Please try again.