ro-poller
v0.1.1
Published
ro-poller creates a stable connection between a ROBLOX server and a nodejs application
Downloads
11
Readme
RO-POLLER
Install
npm install ro-poller --save
Usage
var router = require('express').Router()
var roPoller = require('ro-poller')
var manager = new roPoller({ // defaults
identify: function (req) {
return req.headers['identity']
},
timeout: 1000 * 60 * 1, // 1 minutes,
timeoutCheck: 1000 * 60, // check every 60 seconds
})
router.use((req, res, next) => { // roblox user-agent check
if (safetyCheck === false) return next()
if (
req.headers['user-agent'] !== 'Roblox/WinInet' ||
req.headers['roblox-id'] === undefined
) return res.sendStatus(401);
next()
})
router.post('/create', manager.check(), manager.create())
router.post('/payload', manager.check(), manager.payload())
module.exports = router
/*
manager.connections is a Collection of connections which are indexed by identity
*/