Expand description
The real-ip node — rewrites the client address seen by the rest of the
pipeline (context.request.remote_addr) from a request variable such as
http_x_forwarded_for or http_x_real_ip.
Port of APISIX’s real-ip plugin. The rewrite only happens when the
direct peer address matches trusted_addresses (when configured), so a
client cannot spoof its IP unless the request came through a trusted
proxy. This plugin never fails at execution time: any non-match, missing
header, or unparsable address is a silent passthrough.
Structs§
- Real
IpPlugin - Replaces
context.request.remote_addrwith the address carried by a configured variable, guarded by a trusted-proxy allowlist.
Functions§
- parse_
ip_ 🔒port - Parses
ip,ip:port,[v6]or[v6]:port. ReturnsNonefor unparsable addresses and out-of-range ports (0is rejected, matching APISIX’s port validation).