1.0.0 • Published 12 years ago
auth-socket v1.0.0
auth-socket
easily add authenticated websockets to your http server + session store
npm install auth-socketexample
var opts = { port: 8181 }
var server = require('./')(opts, function onSocket(req, socket, head) {
console.log(req.url, socket)
})
server.httpServer.listen(8181)
console.log('localhost:8181')you can pass in httpServer or webSocketServer instances in as options. auth-socket will handle websocket events and verify them with:
httpServer.doorknob.getProfile(req, function(err, profile) {}TODO make the verification API more generic, right now it is designed to work with doorknob
license
BSD