-
-
Save gitawego/2cc4b4a56552b5051bcd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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