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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.