sails.sockets.unsubscribeFromFirehose()

Unsubscribe from the firehose.

  1. sails.sockets.unsubscribeFromFirehose(socket);

Usage

Argument Type Details
1 socket ((Socket)) A request socket (WebSocket/Socket.io) object
e.g. req.socket.

Example

  1. // Controller action
  2. disableDebugMode: function(req, res) {
  3. if (!req.isSocket) return res.badRequest();
  4. sails.sockets.unsubscribeFromFirehose(req.socket);
  5. return res.ok();
  6. }

Notes

  • The phrase “request socket” here refers to an application-layer WebSocket/Socket.io connection. req.socket also exists for HTTP requests, but it refers to the underlying TCP socket at the transport layer, which is different. Be sure and ensure req.isSocket == true before using req.socket with this method.