Site Search :
Standard Enterprise XML Methodology Pattern Setting Tunning Other
Article Contributors
GuestBook
Javapattern Maven
XSourceGen Dev
JetSpeed Test
JLook Image
jLook Family Site


ProxyÇÏ¿¡¼­ÀÇ Client IP¾ò±â
 
ÇÁ·Ï½Ã»óȲÇÏÀÇ HttpServletRequestÀÇ getRemoteAddr()¸Þ¼Òµå´Â Ŭ¶óÀ̾ðÆ®ÀÇ proxy ip¸¸À» ¸®ÅÏÇÏ°Ô µÇ´Âµ¥ ½ÇÁ¦ ³»ºÎ¾ÆÀÌÇÇÀÇ ³»¿ëÀ» ¾ò¾î¿Ã¼ö ÀÖ´Â ½ºÅ©¸³Æ®¸¦ ÀοëÇÑ´Ù. ( 2003/11/06 ) 176
Written by ienvyou - ÃÖÁö¿õ
1 of 1
 


ÀÌÁ¦ Á¶±Ý «ÀÌ ³ª°Ô µÇ¾î ±ÛÀ» Çϳª¾¿ Çϳª¾¿ ¿Ã¸± ¼ö ÀÖÀ» °Í °°³×¿ä.  º¸Åë ³ª¿Â °á°ú¿¡ ÀÇÇϸç
ÇÁ·ÎÁ§Æ®ÀÇ ¼º°øÈ®·üÀº 30%¶ó°í Çϴµ¥ Á¦°¡ ¼ÓÇÑ ÇÁ·ÎÁ§Æ®°¡ ±× ¿µ¿ª¿¡ Æ÷ÇÔµÉÁö¸¦ ÀǽÉÇÏ¿©
ÀÏÀ» ÇÏ°í ÀÖ½À´Ï´Ù.
¹ãÀ» »õ¿ìÁö ¾Ê¾Æµµ ÇÒ ¼ö ÀÖ´Â ÀÏÀ» ±âȹ, ÃßÁø·ÂµîÀÇ ¹®Á¦Á¡À¸·Î ¸»¹Ì¾Ï¾Æ °³¹ßÀÚµéÀ» ³Ê¹« 
Ȥ»ç½ÃÅ°Áö ¾Ê³ªÇÏ´Â ÀDZ¸½ÉÀÌ µé¾î¼­ À̹ٴÚÀÇ È¸ÀǸ¦ ´À³¥¶§µµ Àֳ׿ä..^^

°¢¼³ÇÏ°í ÀÚ~ À̹ø ¾ÆƼŬÀº ¶Ç ÇÃÁ§½Ã¿¡ ³ªÅ¸³µ´ø ¹®Á¦Á¡À» ÇØ°áÇϱâ À§ÇÏ¿© »ç¿ëÇß´ø ¹æ¾ÈÀ» 
¾²°Ô µË´Ï´Ù. ¾ðÁ¦³ª ±×·¨µí µ¿±âºÎÅÍ ½á ³ª°¡µµ·Ï ÇÑ´Ù.

¢º ¹ß»ý¿øÀÎ

³î»õ~°¡ ¼ÓÇØÀÖ´Â ÇÁ·ÎÁ§Æ®´Â XX¶ó´Â ȸ»çÀÇ »ó´ã¾÷¹«¸¦ ¸Ã´Â Call CenterÀÇ ½Ã½ºÅÛÀ» ±¸ÃàÇÏ´Â 
°ÍÀ̾ú½À´Ï´Ù. ¿ä±¸´Â È£½ºÆ®¿ÍÀÇ Åë½Å ¹× ·ÎÄÃÄÄÇ»ÅÍÀÇ IP¸¦ ÀÌ¿ëÇÏ¿© ¸ðµç ÇÁ·Î±×·¥À» ó¸®ÇÏ°Ô
µÇ¾îÀִµ¥ ¹®Á¦´Â ÇÁ·Ï½ÃÇÏÀÇ IP¸¦ javaÀÇ HttpServletRequestÀÇ getRemoteAddr()À̶ó´Â ¸Þ¼Òµå°¡
´Ü¼øÈ÷ ÇÁ·Ï½Ã IP¸¸À» ¸®ÅÏÇÏ°í ÀÖ´Ù´Â ¹®Á¦¿´½À´Ï´Ù.

¹Ýµå½Ã °øÅë¸ðµâ·ÎÀÇ ·Î±×Àνÿ¡ ÇØ´çÇÏ´Â ÄÄÇ»ÅÍÀÇ IP¸¦ ¾ò¾î³»¾ß ÇÏ´Â ¹®Á¦Á¡À̾ú°ÚÁÒ?

¢º ÀܸӸ® ±¼¸®±â

ÀÚ~ ÀÌ°É ¾î¶»°Ô ÇØ°áÀ» ÇØ¾ß ÇÒ±î¿ä? À̱ÛÀ» Àд ´Ô²²¼­µµ Çѹø »ý°¢À» Çغ¸¼Å¾ß ÇÏÁö ¾ÊÀ»±î ÇÕ´Ï´Ù.

À½..ÇÁ·Ï½Ã »óȲÇÏÀÇ IPüũ¶ó~ ¹é³¯ Á×¾î¶ó request¸¦ ³¯·Áµµ ±× ¼º´ÉÁÁÀº proxy server°¡ Çì´õ¸¦
°¡·Îä±â¸¦ Çϴµ¥ ¸»ÀÌÁÒ..
óÀ½À¸·Î °£´ÜÇÏ°Ô Á¦°¡ »ý°¢ÇÑ ¹æ¹ýÀº ÀÌ·¸½À´Ï´Ù.

ÀÚ¹Ù¸¦ ÇÏ´Ï ´ç¿¬È÷ signed appletÀ» µÎ¾î Ŭ¶óÀ̾ðÆ®ÀÇ InetAddress¸¦ ¾ò¾î³» local address¸¦ ¾ò¾î³½ÈÄ
File permissionÀ» ÁÖ¾î hiddenÆÄÀÏ·Î ¼³Á¤À» ÇÏ¿© ´ÙÀ½·Î±×Àνà ip¸¦ ÇØ´ç ÆÄÀϷκÎÅÍ ÀоÈÄ webÀ¸·Î
½î¾ÆÁÖ´Â ¹æ¹ýÀÌ°ÚÁÒ.
ÀÌ·± ¹æ¹ýÀº S-Networks¶õ ȸ»ç¿¡¼­ ¾²¿´´ø ¹æ¹ýÀ̾ú´Âµ¥ Á»´õ ½±°Ô ÇÒ ¼ö ¾øÀ»±î ÇÏ´Â ÀܸӸ®¸¦ 
±¼¸®±â ½ÃÀÛÀ» ÇßÁö¿ä.

VBScript?, JScript? Èì.asp¸¦ Æ÷ÇÔÇÏ¿© »ç¿ëÇÏÀÚ´Ï ¼­¹ö´Â IBMHttpWebServer¸¦ 
»ç¿ëÇÏ°í À־ Á¶±Ý °ï¶õÇÑ »óȲÀÌ°í~
¶ÇÇÑ shtml¿¡¼­ ÇØ´ç ÇÏ´Â IP¸¦ ½ºÅ©¸³Æ®·Î Àо ¼ö ÀÖ´Â ¹æ¹ýÀÌ ÀÖ¾ú´Âµ¥ WAS¿ÍÀÇ plug-in¼³Á¤¿¡
shtml¿¡ ´ëÇÑ ºÎºÐÀ» Çã¿ëÇÏÁö ¾Ê¾Æ ¾Æ·¡¿Í °°Àº secure script¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù´Â °ÍÀÌ ¹®Á¦¿´½À´Ï´Ù.

// This part gets the IP
var ip = '<!--#echo var="REMOTE_ADDR"-->';

// This part is for an alert box
alert("Your IP address is "+ip);

À§ÀÇ ³»¿ëÀ» shtml·Î ¼³Á¤ÇÑ ÈÄ ÀÏ¹Ý apache webserver¿¡¼­ ÀÛµ¿À» ½ÃÅ°¸é Á¤È®ÇÏ°Ô ¾ò¾î³¾ ¼ö 
ÀÖ¾ú½À´Ï´Ù.

Èì. ¿ì¼± IE¿Í Àß ¿¬µ¿ÀÌ µÉ ¼öÀÖÀ¸¸ç brower parser°¡ ÀνÄÀ» ÇÒ ¼ö ÀÖ¾î¾ß Çϴ°ÍÀÌÁÒ.

À̶§ »ý°¢ÀÌ ¾Æ~¶Ù¹Ù NetscapeÀº ÀÚ¹Ù API¸¦ Á¦°øÀ» ÇÏ°í ½ÇÇà±îÁö ½ÃÄÑÁֱ⶧¹®¿¡ ½±°Ô
¾Ë¾Æ³¾¼ö Àִµ¥ °©ÀÚ±â IE°¡ ¹Ì¿öº¸ÀÌ´Â °Ô ¾Æ´Ï°Ú½À´Ï±î?

°á±¹ JScript API¸¦ µÚÁ®¼­ ActiveX¸¦ ÀÌ¿ëÇÑ ÇÁ·Ï½ÃÇÏÀÇ client ip¸¦ ¾ò¾î³»´Âµ¥ ¼º°øÀ» ÇÏ¿´½À´Ï´Ù.
±×·±µ¥ ¹®Á¦´Â ¼­¸íÀÌ ¾ÈµÈ ÀÌÀ¯·Î IEÀÇ º¸¾È¼öÁØÀÌ ³·°Ô ¼³Á¤µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù´Â °ÍÀÌÁÒ.

¾Æ´Ï¸é ¼­¸íÀ» ÇÏ¿© ½ÇÇàÀ» ½ÃÅ°´øÁö¿ä.

¿ì¼± ÇØ´ç ÇÁ·Ï½ÃÇÏÀÇ Å¬¶óÀ̾ðÆ® ¾ÆÀÌÇÇÁÖ¼Ò¸¦ ¾ò¾î³¾ ¼ö ÀÖ´Â ½ºÅ©¸³Æ®¸¦ Àû¾îº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title></title>

        <script>
           function test() {
                alert(document.formbar.txtIPAddr.value);
           }
     </script>

<script FOR="foo" EVENT="OnCompleted(hResult, pErrorObject, pAsyncContext)" LANGUAGE="JScript">
     document.formbar.txtIPAddr.value=unescape(IPAddr);
</script>
  <script FOR="foo" EVENT="OnObjectReady(objObject, objAsyncContext)" LANGUAGE="JScript">

  if(objObject.IPEnabled != null && objObject.IPEnabled != "undefined" && objObject.IPEnabled == true)
   {
       if(objObject.IPEnabled && objObject.IPAddress(0) != null && objObject.IPAddress(0) != "undefined")
             IPAddr = objObject.IPAddress(0);
  }
     </script>

    </head>
    <body>
        <p>
            <FONT color="red"><span ID="info"></FONT>
            <object classid="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6" id="locator" VIEWASTEXT>
            </object>
            <object classid="CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223" id="foo">
            </object>

            <script LANGUAGE="JScript">
                    var service = locator.ConnectServer();
                    var IPAddr ;
                    service.Security_.ImpersonationLevel=3;
                    service.InstancesOfAsync(foo, 'Win32_NetworkAdapterConfiguration');
                </script>
        </p>


<form method="POST" action="" id="formfoo" name="formbar">
	<input type="hidden"  name="txtIPAddr">
    <input type='button' onclick='test()' value='test'>
</form>


	</body>
</html>

Å×½ºÆ®Çغ¸½Ã±â ¹Ù¶ø´Ï´Ù. ÂüÁ¶¹®¼­ : WMI HTML Script reference page
 
1
References
 
WMI HTML Script reference page
Copyright ¨Ï 2003 www.javapattern.info & www.jlook.com, an jLOOK co.,LTD