Skip to content

Instantly share code, notes, and snippets.

@thadclay
Forked from pauldenotter/plugin.js
Created August 24, 2014 21:55
Show Gist options
  • Save thadclay/40711d81a82ec2c654a8 to your computer and use it in GitHub Desktop.
Save thadclay/40711d81a82ec2c654a8 to your computer and use it in GitHub Desktop.
var socketIO = require('socket.io'),
io;
// hapi plugin registration
exports.register = function(plugin, options, next) {
// this is the hapi specific binding
io = socketIO.listen(plugin.servers[0].listener);
io.sockets.on('connection', function(socket) {
socket.emit({msg: 'welcome'});
});
next();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment