Depending on exactly why you want the ip address you could do something like
this:

<cfset IPAddresses = arrayNew(1)>

<cfset net = createObject('java','java.net.NetworkInterface')>
<cfset interfaces = net.getNetworkInterfaces()>

<cfloop condition="#interfaces.hasMoreElements()#">
<cfset interface = interfaces.nextElement()>
<cfset addresses = interface.getInetAddresses()>
<cfloop condition="#addresses.HasMoreElements()#">
<cfset address = addresses.nextElement()>
<cfset arrayAppend(IPAddresses,address.toString())>
</cfloop>
</cfloop>

<cfdump var="#IPAddresses#">

That will probably come out with a '/' in front of each address, but you
should be able to sort that out easily enough.

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org


>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of S.Isaac Dealey
>Sent: Tuesday, July 06, 2004 1:27 PM
>To: CF-Talk
>Subject: Re: easiest way to grab server's internal ip?
>
>> What's the most simple CFMX way to grab the app server's
>> IP address internal
>> to the firewall? Is there some type of
>> server.getSystemIP() or something
>> like that?
>
>> Jon
>
>There's nothing native. You could execute ipconfig with the cfexecute
>tag tho.
>
>
>s. isaac dealey   214.823.9345
>
>new epoch : isn't it time for a change?
>
>add features without fixtures with
>the onTap open source framework
>http://www.sys-con.com/story/?storyid=44477&DE=1
>
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to