Skip to content

trustedHopsFromEnv

trustedHopsFromEnv(env): TrustedHops

The trusted proxies from TRUST_PROXY, for AuthModule’s trustedHops.

  • A whole number is a hop count, from 0 to 16.
  • Anything else is a comma-separated list of proxy addresses, CIDR ranges and the Express presets loopback, linklocal and uniquelocal (such as loopback, 10.0.0.0/8), returned with the presets expanded to the ranges Express uses.
  • Unset (or empty) is 0 outside production and refused in production; false is 0 anywhere; true, an unknown name and a malformed range are refused.

TrustProxyEnv

TrustedHops