需要抓取代理后面的客户端ip地址

Need to capture the client ip address behind the proxy

当客户端试图访问 java 中代理后面的服务器时,我正在尝试获取客户端的 IP 地址。我尝试了以下所有方法,但似乎没有用。仅在没有代理时有效

Using getRemoteAddr() method
"X-FORWARDED-FOR"
"HTTP_X_FORWARDED_FOR"
"HTTP_X_FORWARDED"
"HTTP_X_CLUSTER_CLIENT_IP"
"HTTP_CLIENT_IP"
"HTTP_FORWARDED_FOR"
"HTTP_FORWARDED"
"HTTP_VIA"
"REMOTE_ADDR"

我解决了这个问题..我发现 x-forwarded-for 只是 x-forwarded...因此返回值 null..我不确定是谁配置错了