public static String getRealIpAddr(HttpServletRequest request) {
String ip = request.getHeader("X-Real-IP");
if ((ip == null) || (ip.length() == 0)
|| ("unknown".equalsIgnoreCase(ip))) {
ip = request.getHeader("Proxy-Client-IP");
}
if ((ip == null) || (ip.length() == 0)
|| ("unknown".equalsIgnoreCase(ip))) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if ((ip == null) || (ip.length() == 0)
|| ("unknown".equalsIgnoreCase(ip))) {
ip = request.getRemoteAddr();
}
return ip;
}

相关文章:

  • 2022-12-23
  • 2021-09-16
  • 2022-01-04
  • 2021-11-18
  • 2022-02-12
  • 2021-11-03
  • 2021-09-30
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-12-05
  • 2021-09-18
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案