How to use the proxy-addr.compile function in proxy-addr

To help you get started, we’ve selected a few proxy-addr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github visionmedia / superagent / test / support / express / utils.js View on Github external
};
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function(a, i) {
      return i < val;
    };
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */);
  }

  return proxyaddr.compile(val || []);
};
github dadi / web / dadi / lib / api / middleware.js View on Github external
}
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function (a, i) {
      return i < val
    }
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */)
  }

  return proxyaddr.compile(val || [])
}
github katzer / cordova-plugin-badge / node_modules / cordova-browser / node_modules / express / lib / utils.js View on Github external
if (val === true) {
    // Support plain true/false
    return function(){ return true };
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function(a, i){ return i < val };
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */);
  }

  return proxyaddr.compile(val || []);
}
github entermedia-community / entermedia-server / webapp / examples / annotations / workspace / node_modules / express / lib / utils.js View on Github external
if (val === true) {
    // Support plain true/false
    return function(){ return true };
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function(a, i){ return i < val };
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */);
  }

  return proxyaddr.compile(val || []);
}
github OrgCurrent / Android / node / express / lib / utils.js View on Github external
if (val === true) {
    // Support plain true/false
    return function(){ return true };
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function(a, i){ return i < val };
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */);
  }

  return proxyaddr.compile(val || []);
}
github tejasmanohar / twilio-plays-2048 / node_modules / express / lib / utils.js View on Github external
if (val === true) {
    // Support plain true/false
    return function(){ return true };
  }

  if (typeof val === 'number') {
    // Support trusting hop count
    return function(a, i){ return i < val };
  }

  if (typeof val === 'string') {
    // Support comma-separated values
    val = val.split(/ *, */);
  }

  return proxyaddr.compile(val || []);
}
github adonisjs / adonis-framework / packages / node-req / src / Request / index.js View on Github external
return i < value
    }
  }

  /**
   * Support comma-separated values
   */
  if (typeof value === 'string') {
    value = value.split(/ *, */)
  }

  /**
   * Finally let proxyaddr understand
   * and compile the input.
   */
  return proxyaddr.compile(value || [])
}
github calzoneman / sync / src / web / middleware / x-forwarded-for.js View on Github external
export function initialize(app, webConfig) {
    const trustFn = proxyaddr.compile(webConfig.getTrustedProxies());

    app.use(readProxyHeaders.bind(null, trustFn));
}
github calzoneman / sync / src / io / ioserver.js View on Github external
constructor(options = {
        proxyTrustFn: proxyaddr.compile('127.0.0.1')
    }) {
        ({
            proxyTrustFn: this.proxyTrustFn
        } = options);

        this.ipThrottle = new Map();
        this.ipCount = new Map();
    }

proxy-addr

Determine address of proxied request

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular proxy-addr functions