Reputation: 85
I am building a Flex application which communicates with a Java server using BlazeDS.
What would be the best way to go about making the server aware of the client's hostname?
Thanks.
Upvotes: 1
Views: 1122
Reputation: 3155
You can't determine the client's hostname from within Flex and it's not possible with JavaScript either. However, you can try to lookup the hostname on the server side using a reverse DNS lookup.
First, you'll need to determine the client's IP address. Take a look at "Can I get the client's IP address in an LCDS service call?" for an example on how to do it in BlazeDS.
In order to get the hostname you need to execute a reverse DNS lookup for the IP address. Please keep in mind that not every IP address has a hostname that can be determined throug reverse DNS lookups.
Upvotes: 1