🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

drachtio-mw-apiban

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drachtio-mw-apiban

drachtio middleware that uses LOD's apiban to reject spammers

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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});

Keywords

apiban

FAQs

Package last updated on 24 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts