Gooday Note Scrap Source Android login
 
작성일 : 13-03-07 18:42
클라이언트 실제 IP 확인하기
 글쓴이 : 기리 (123.♡.195.24)
조회 : 3,177  
   http://blog.stclab.co.kr/?p=6&fb_comment_id=fbc_538678222843975_598722… [1527]

String clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
if(null == clientIp || clientIp.lenght() == 0
   || clientIp.toLowerCase().equals("unknown")){
  clientIp = request.getHeader("REMOTE_ADDR");
}

if(null == clientIp || clientIp.lenght() == 0
   || clientIp.toLowerCase().equals("unknown")){
  clientIP = request.getRemoteAddr();
}