Перейти к содержимому
Русский

IpAllowlistOptions

Это содержимое пока не доступно на вашем языке.

Defined in: src/http/middleware/IpAllowlist.ts:30

readonly allow: readonly string[]

Defined in: src/http/middleware/IpAllowlist.ts:35

One or more CIDR strings. At least one must match the resolved client IP or the request gets a 403.


readonly optional getClientIp?: (req) => string | null | undefined

Defined in: src/http/middleware/IpAllowlist.ts:45

Override the IP-extraction step. Default: req.remoteAddress. Common override for deployments behind a trusted proxy:

getClientIp: (req) => req.headers['x-forwarded-for']?.split(',')[0]?.trim()

Returning null / undefined makes the request fail closed (403) — no IP means no decision means deny.

HttpRequest

string | null | undefined