socket.io-wildcard

Extends socket.io with a wildcard event.

npm install socket.io-wildcard
69 downloads in the last day
361 downloads in the last week
1 205 downloads in the last month

socket.io-wildcard build status

Extends socket.io with a wildcard event.

Examples

var socketio = require( 'socket.io' ),
    socketioWildcard = require( 'socket.io-wildcard' ),
    io = socketioWildcard( socketio ).listen( 8000 );

io.sockets.on( 'connection', function onConnection ( socket ) {
  socket.on( '*', function onWildcard ( event ) {
    // > { name: 'cake', args: [ { 'is a lie': true }, 'another argument' ] }
    console.log( event );
  } );

  socket.emit( 'cake', { 'is a lie': true }, 'another argument' );
} );
npm loves you