I’m programming a simple web browser depending on NanoHTTPD project and it’s required to get number of visitors using the IP address.
Are there any ways to get the client IP using NanoHTTPD?
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.
In NanoHTTPD.java, find the private class HTTPSession object.
Inside this is public void run(). Find the following line and add the second line after it.
Now inside your serve function, you can just reference the IPAddress header to get the client’s ip address.
I know the answer is probably too late to help you, but hopefully it’ll help others searching for the same thing.