Socketcluster Versions Save

Highly scalable realtime pub/sub and RPC framework

v6.4.0

6 years ago
  • Added a master.js (masterController) file to the default boilerplate. This file is a good place to put code that would normally go in server.js (master process) - Unlike server.js, master.js can also be used when running SC as a container.
  • Added three new events on the SocketCluster master object: workerClusterStart, workerClusterReady and workerClusterExit.

v6.2.0

6 years ago

Updated the bundled version of socketcluster-client to v6.2.0. There are no breaking changes to SocketCluster itself but there is a minor breaking change on the client. See https://github.com/SocketCluster/socketcluster-client/releases/tag/v6.2.0

v6.1.0

6 years ago

Breaking change

Note that the affected feature was not publicly documented on the website. That's why this is only a minor release.

There is a change to the optional callback to the client socket.publish(channelName, data, callback) function. The second argument to the callback used to be the data which was published to the channel (after all transformations had been carried-out by the middleware), now the second argument will be undefined by default. The second argument now needs to be specified explicitly inside the MIDDLEWARE_PUBLISH_IN middleware like this:

scServer.addMiddleware(scServer.MIDDLEWARE_PUBLISH_IN, function (req, next) {
  // This is how you can send back data as the second argument to the client `socket.publish` callback.
  // Note that if you have multiple middleware functions in the MIDDLEWARE_PUBLISH_IN line, the 
  // next middleware function will be able to access the existing req.ackData property and modify it.
  // It's the final state of req.ackData which will be sent back to the client.
  req.ackData = {someCustomProperty: 'This is some data to send back'};
  next();
});

If you want to maintain the old behaviour without having to think, you can just add this middleware function in your code after all other middleware functions in the MIDDLEWARE_PUBLISH_IN line:

scServer.addMiddleware(scServer.MIDDLEWARE_PUBLISH_IN, function (req, next) {
  req.ackData = req.data;
  next();
});

v6.0.1

6 years ago

Added new events on the SCServer object which refer to a socket. This allows developers to listen to certain socket events from a central place. These new events are:

  • subscription
  • unsubscription
  • authentication
  • deauthentication

Also, fixed the authenticate and deauthenticate events on the server-side socket (SCSocket) object - Before, these events were not always being triggered correctly. These events were not officially documented on the website until now (unlike the client-side socket's authenticate and deauthenticate events).

Breaking change

The handler to the badSocketAuthToken event (which is emitted on SCServer) used to accept a single status object argument. Now it accepts two arguments; the first of which is the socket object and the second of which is the status object. Note that the status object no longer has a socket property.

v5.14.0

6 years ago

No longer using raw errors from jsonwebtoken module. Now JWT errors will be converted on the server side to SC errors which match those sent to the client.

v5.8.0

7 years ago

Upgraded uws to version 0.13.0.

v5.7.1

7 years ago

Added missing badSocketAuthToken event on the server. See http://socketcluster.io/#!/docs/api-scserver Added missing badAuthToken event on the server-side socket. See http://socketcluster.io/#!/docs/api-scsocket-server

Note that the documentation for these events existed on the website for a long time but these events were actually missing in new versions of SC until now. Note that the docs on the website have been updated to reflect the latest implementation.

v5.6.0

7 years ago

The server-side socket object now has a signedAuthToken property which contains the signed JWT when authentication succeeds.

v5.4.0

7 years ago

Added support for MIDDLEWARE_AUTHENTICATE middleware.

0.9.81

9 years ago