1.0.8 • Published 5 years ago

express-server-toolbox v1.0.8

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

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.

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago