Nebulous Pumpkin Moons

    This package has been deprecated

    Author message:

    Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

    express-server-toolbox

    1.0.8 • Public • Published

    express-server-toolbox

    Includes

    1. DDOS, Spam & Brute force protection
    2. Proxy server for all request/response types
    3. Get and Post parameters get sanitized

    Example

    // NPM Packages
    const expressServerToolkit = require("express-server-toolkit");
    const express = require("express");
    // Setting up the proxy [Host, Port, Enctype, Timeout]
    const ProxyLocalhost = new expressServerToolkit.proxy(
      "localhost",
      8080,
      "http",
      3000
    );
    // Setting up the DDOS Prevention [MongoDB URI, Max requests per hour]
    // Keep in mind that the images/post also count as request, so have at least a limit of a few thousand.
    const DDOSPrevention = new expressServerToolkit.DDOSPrevention(
      "mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb",
      5000
    );
    // Connects the database
    DDOSPrevention.connectMongo(err => {
      if (!err) {
        // Prevents DDOS, Bruteforce etc
        app.use(DDOSPrevention.prevent);
        // Express firewall currently only handles sanitize of get/post parameters
        app.use(expressServerToolkit.ExpressFirewall);
        // Handles the requests
        app.use("*", (req, res, next) => {
          // Checks the domain/hostname
          if (req.hostname === "localhost") {
            // Proxy's the request
            ProxyLocalhost.web(req, res, next);
          }
        });
      } else {
        throw err;
      }
    });

    I am not responsible for security breaches or any other trouble. I am developing this for self education, and it's your choise to use.

    Install

    npm i express-server-toolbox

    DownloadsWeekly Downloads

    2

    Version

    1.0.8

    License

    ISC

    Unpacked Size

    16.7 kB

    Total Files

    10

    Last publish

    Collaborators

    • skywa04885