I'm happy to announce the release of v2.1.0 of Ration.js this new release includes several performance improvements and bug fixes as well as a new option to forcibly drop connections of offending users instead of slowing their requests down.
Simply set dropConnections to true in your rationjs options and any user exceeding their rations will have their requests dropped instead of being queued up with a delay.
/* Set Ration.js Options */
const rations = {
maxRequestsPerTimeFrame: 600,
timeFrameInSeconds: 30,
removeRecordsAfter: (1000 * 60 * 5),
dropConnections: true
};
rationjs.setRations(rations);
/* Use Ration.js */
app.use(rationjs.startRations);