Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

express-extras

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-extras

ExpressJS Helpers

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
5
-66.67%
Maintainers
0
Weekly downloads
 
Created
Source

h1. ExpressJS Extras Package

This package contains extra middleware options for ExpressJS.

Currently it only contains 2, but I will be adding to them as I need them ;)

h2. Installation

npm install express-extras

h2. extras.fixIP

This middleware module attempts to normalize req.socket.remoteAddress
when working with a proxy (like nginx).
app.configure(function(){

    app.use(extras.fixIP());
    //Or
    app.use(extras.fixIP([
        'x-forwarded-for',
        'forwarded-for',
        'x-cluster-ip'
    ]));

});

h2. extras.throttle

Attempts to throttle requests based on the number of times a given resource is accessed.
Once the throttle is reached, a 403 is served to them for the "holdTime" (default 10 seconds)
127.0.0.1 is automatically whitelisted (for development, monit, nagios, etc..)
Probably should be used with/after extras.fixIP so that the users real IP is sent to the throttle.
app.configure(function(){

    Use the defaults..
    app.use(extras.throttle());

    //Or supply a config object
    //The default config shown..
    app.use(extras.throttle({
      urlCount: 5,
      urlSec: 1,
      holdTime: 10,
      whitelist: {
          '127.0.0.1': true
      }
    }));

});

h2. Dependancies

"Express":http://expressjs.com/ : LICENSE (MIT)

npm install express

"Connect":http://github.com/senchalabs/connect : LICENSE (MIT)

npm install connect

FAQs

Package last updated on 13 Dec 2011

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