Skip to content

Function: clientIp()

clientIp(req): string

Client IP for rate-limiting: the RIGHTMOST x-forwarded-for entry (the value the nearest trusted hop - portr - wrote), else the socket address. Reading the rightmost, not the leftmost, stops a caller minting a fresh rate-limit bucket by varying the header. Called before stripHeaders.

IncomingMessage

string