@sigiljs/sigil
Version:
TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating
23 lines (22 loc) • 683 B
TypeScript
import { IncomingMessage } from 'node:http';
/**
* Information about client IP addresses extracted from request.
*/
export interface ClientIpInfo {
/**
* The primary client IP (first in the list) or null if none.
*/
ip: string | null;
/**
* List of all candidate client IPs in order of trust.
*/
ips: string[];
}
/**
* Extracts client IP information from an incoming HTTP request.
* Supports standard headers and falls back to socket address.
*
* @param req incoming HTTP message object.
* @returns object containing the primary IP and list of candidate IPs.
*/
export declare function getClientIpInfo(req: IncomingMessage): ClientIpInfo;