drachtio-mw-apiban

1.0.1 • Public • Published

drachtio-mw-apiban

drachtio middleware that uses APIBAN from [LOD] to reject incoming requests from known spammers.

Usage

const apiban = require('drachtio-mw-apiban')({apikey: 'xxx'});
const srf = require('drachtio-srf');

srf.use(apiban);
srf.invite((req, res) => {..});

The middleware returns a function that is executed with your api key. By default, calls from a source address that matches a banned IP are rejected with a 403. This can be changed by passing an optional desired status code as shown below.

const apiban = require('drachtio-mw-apiban')({apikey: 'xxx', statusCode: 603});

Readme

Keywords

Package Sidebar

Install

npm i drachtio-mw-apiban

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.96 kB

Total Files

6

Last publish

Collaborators

  • beachdog