Get IP address of client in JSP

前端 未结 4 768
慢半拍i
慢半拍i 2021-02-09 11:36

I need to get the IP address of the client in the JSP page. I have tried the following ways:

request.getRemoteAddr()
request.getHeader(\"X_FORWARDED_FOR\")
reque         


        
4条回答
  •  温柔的废话
    2021-02-09 12:01

    Is your application server behind a load balancer, a proxy or a web server? Just an example; F5 load balancer exposes the client IP address with the "rlnclientipaddr" header:

    request.getHeader("rlnclientipaddr");
    

提交回复
热议问题