How to use proxy-addr - 10 common examples

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 visionmedia / superagent / test / support / express / requestDecorator.js View on Github external
defineGetter(req, 'ips', function ips() {
    const trust = this.app.get('trust proxy fn');
    const addrs = proxyaddr.all(this, trust);

    // reverse the order (to farthest -> closest)
    // and remove socket address
    addrs.reverse().pop();

    return addrs;
  });
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 foxifyjs / foxify / src / Request.ts View on Github external
public get ips() {
    const addresses = proxyAddr.all(this, SETTINGS["trust.proxy"]);

    // reverse the order (to farthest -> closest)
    // and remove socket address
    addresses.reverse().pop();

    return addresses;
  }
github scottgarner / Tweetopia / node_modules / express / lib / request.js View on Github external
defineGetter(req, 'ips', function ips() {
  var trust = this.app.get('trust proxy fn');
  var addrs = proxyaddr.all(this, trust);

  // reverse the order (to farthest -> closest)
  // and remove socket address
  addrs.reverse().pop()

  return addrs
});
github ILIAS-eLearning / ILIAS / Modules / Chatroom / chat / node_modules / express / lib / request.js View on Github external
defineGetter(req, 'ips', function ips() {
  var trust = this.app.get('trust proxy fn');
  var addrs = proxyaddr.all(this, trust);

  // reverse the order (to farthest -> closest)
  // and remove socket address
  addrs.reverse().pop()

  return addrs
});

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