콘텐츠로 이동
한국어

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