node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey ยป

This library is a temporary stop-gap for using's broadcast method under

npm install

Original problem

cluster works great when it comes to short lived connections. connections are 'sticky' which make them stay on a single node process. This is problematic when you want to send a message to every client connected.

How does it work?

Unix sockets handle communication between silo->cluster->silos.


var bridge = require('')

  • bridge.master(io [, host, port])
  • socket is the server object returned by
  • host is an ip address use for only internal connections (defaults to
  • port is the port on which the cluster server will listen on (defaults to 43000)


var http   = require('http')
  , fs     = require('fs')
  , io     = require('')
  , bridge      = require('')
  , socketPath  = __dirname + '/sockets'
  , server
  , socket;

server = http.createServer(function(req, res){
  res.writeHead(200, {'Content-Type': 'text/html'});

socket = io.listen(server)

io.on('connection', function(client){
  // Use as you normally would