code: public static String getClientIP(HttpRequestInfo request)
      {
          final String xForwardedFor = request.getHeaders().getFirst(HttpHeaderNames.X_FORWARDED_FOR);
          String clientIP;
          if (xForwardedFor == null) {
              clientIP = request.getClientIp();
          } else {
              clientIP = extractClientIpFromXForwardedFor(xForwardedFor);
          }
          return clientIP;
      }
docs: Get the IP address of client making the request.
  
  Uses the "x-forwarded-for" HTTP header if available, otherwise uses the remote
  IP of requester.
  
  @param request <code>HttpRequestMessage</code>
  @return <code>String</code> IP address