code: public static String getClientIpAddr(HttpServletRequest request) {
          for (String header : HEADERS_ABOUT_CLIENT_IP) {
              String ip = request.getHeader(header);
              if (ip != null && ip.length() != 0 && !"unknown".equalsIgnoreCase(ip)) {
                  return ip;
              }
          }
          return request.getRemoteAddr();
      }
docs: get client ip
  @param request current request
  @return client ip