Hi Graham,
I am unsure to be honest, I can ping the client and ask though,
however, Remote_Addr returns a valid IP (pity its the same for each
client workstation due to it being a corporate network setup), its the
HTTP_X_Forwarded_For that is returning as an empty string or undefined
value.
Thanks,
Simon
On 23 Jul 2008, at 15:50, Graham Pearson wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Does the application happen to be running on Windows 2000 Pro with
Apache? I had this same issue and until I added one line into the
httpd.conf file, I was unable to to use the CGI.Remote_Addr as it would
return 0.0.0.0 or unknown.
Simon Bailey wrote:
| Hi all,
|
| I would like to do some conditional checking in a Flex app based on
| Local (not proxy) IP address of the user. I have looked at using the
| below:
|
| <cfif #CGI.HTTP_X_Forwarded_For# EQ "">
| <cfset ipaddress="#CGI.Remote_Addr#">
| <cfelse>
| <cfset ipaddress="#CGI.HTTP_X_Forwarded_For#">
| </cfif>
| <cfreturn ipaddress />
|
| But found on a friend testing within a coorporate environment it
| returned unknown, further research discovered that both Remote_Addr &
| HTTP_X_Forwarded_For are unrelieable so I dug further and came up with
| the below. The query actually returned a binary value which did not
| have the typical IP format I am used to (it was something like
| 98-2342124)? Is this ok do you reckon, any one got any opinions on
| this?
|
| <cfcomponent hint="Query IP">
|
| <cffunction name="checkIP" access="remote" returntype="binary"
| hint="Return Current User IP">
|
| <cfset ipaddress=CreateObject("java",
| "java.net.InetAddress").getLocalHost().getAddress()>
|
| <cfreturn ipaddress />
|
| </cffunction>
|
| </cfcomponent>
|
| Cheers,
|
| Simon
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive: http://www.houseoffusion.com/groups/Flex/message.cfm/messageid:5436
Subscription: http://www.houseoffusion.com/groups/Flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37