(options: ProxyOptions): MiddlewareHandler Create a Hono middleware that resolves the client IP from trusted proxies.
Sets client_ip on the Hono context for downstream use by get_client_ip.
All client IPs are normalized (lowercase, IPv4-mapped IPv6 stripped).
Resolution logic:
1. No X-Forwarded-For → use connection IP directly.
2. X-Forwarded-For present but connection is untrusted → ignore header
(spoofed by a direct attacker), use connection IP.
3. X-Forwarded-For present and connection is trusted → walk header
right-to-left, strip trusted entries, use first untrusted entry.
options
trusted proxy configuration
returns
MiddlewareHandler